├── .idea ├── inspectionProfiles │ └── Project_Default.xml ├── libraries │ ├── SBT__aopalliance_aopalliance_1_0_jar.xml │ ├── SBT__com_chuusai_shapeless_2_11_2_0_0_jar.xml │ ├── SBT__com_clearspring_analytics_stream_2_7_0_jar.xml │ ├── SBT__com_esotericsoftware_kryo_shaded_3_0_3_jar.xml │ ├── SBT__com_esotericsoftware_minlog_1_3_0_jar.xml │ ├── SBT__com_fasterxml_jackson_core_jackson_annotations_2_6_5_jar.xml │ ├── SBT__com_fasterxml_jackson_core_jackson_core_2_6_5_jar.xml │ ├── SBT__com_fasterxml_jackson_core_jackson_databind_2_6_5_jar.xml │ ├── SBT__com_fasterxml_jackson_module_jackson_module_paranamer_2_6_5_jar.xml │ ├── SBT__com_fasterxml_jackson_module_jackson_module_scala_2_11_2_6_5_jar.xml │ ├── SBT__com_github_fommil_netlib_core_1_1_2_jar.xml │ ├── SBT__com_github_rwl_jtransforms_2_4_0_jar.xml │ ├── SBT__com_google_code_findbugs_jsr305_1_3_9_jar.xml │ ├── SBT__com_google_guava_guava_14_0_1_jar.xml │ ├── SBT__com_google_inject_guice_3_0_jar.xml │ ├── SBT__com_google_protobuf_protobuf_java_2_5_0_jar.xml │ ├── SBT__com_ning_compress_lzf_1_0_3_jar.xml │ ├── SBT__com_thoughtworks_paranamer_paranamer_2_6_jar.xml │ ├── SBT__com_twitter_chill_2_11_0_8_0_jar.xml │ ├── SBT__com_twitter_chill_java_0_8_0_jar.xml │ ├── SBT__com_typesafe_akka_akka_actor_2_11_2_3_8_jar.xml │ ├── SBT__com_typesafe_config_1_2_1_jar.xml │ ├── SBT__com_univocity_univocity_parsers_2_2_1_jar.xml │ ├── SBT__commons_beanutils_commons_beanutils_1_7_0_jar.xml │ ├── SBT__commons_beanutils_commons_beanutils_core_1_8_0_jar.xml │ ├── SBT__commons_cli_commons_cli_1_2_jar.xml │ ├── SBT__commons_codec_commons_codec_1_10_jar.xml │ ├── SBT__commons_collections_commons_collections_3_2_1_jar.xml │ ├── SBT__commons_configuration_commons_configuration_1_6_jar.xml │ ├── SBT__commons_digester_commons_digester_1_8_jar.xml │ ├── SBT__commons_httpclient_commons_httpclient_3_1_jar.xml │ ├── SBT__commons_io_commons_io_2_1_jar.xml │ ├── SBT__commons_lang_commons_lang_2_5_jar.xml │ ├── SBT__commons_net_commons_net_2_2_jar.xml │ ├── SBT__io_dropwizard_metrics_metrics_core_3_1_2_jar.xml │ ├── SBT__io_dropwizard_metrics_metrics_graphite_3_1_2_jar.xml │ ├── SBT__io_dropwizard_metrics_metrics_json_3_1_2_jar.xml │ ├── SBT__io_dropwizard_metrics_metrics_jvm_3_1_2_jar.xml │ ├── SBT__io_netty_netty_3_8_0_Final_jar.xml │ ├── SBT__io_netty_netty_all_4_0_42_Final_jar.xml │ ├── SBT__javax_annotation_javax_annotation_api_1_2_jar.xml │ ├── SBT__javax_inject_javax_inject_1_jar.xml │ ├── SBT__javax_servlet_javax_servlet_api_3_1_0_jar.xml │ ├── SBT__javax_validation_validation_api_1_1_0_Final_jar.xml │ ├── SBT__javax_ws_rs_javax_ws_rs_api_2_0_1_jar.xml │ ├── SBT__log4j_log4j_1_2_17_jar.xml │ ├── SBT__net_java_dev_jets3t_jets3t_0_7_1_jar.xml │ ├── SBT__net_jpountz_lz4_lz4_1_3_0_jar.xml │ ├── SBT__net_razorvine_pyrolite_4_13_jar.xml │ ├── SBT__net_sf_opencsv_opencsv_2_3_jar.xml │ ├── SBT__net_sf_py4j_py4j_0_10_4_jar.xml │ ├── SBT__net_sourceforge_f2j_arpack_combined_all_0_1_jar.xml │ ├── SBT__org_antlr_antlr4_runtime_4_5_3_jar.xml │ ├── SBT__org_apache_avro_avro_1_7_7_jar.xml │ ├── SBT__org_apache_avro_avro_ipc_1_7_7_jar.xml │ ├── SBT__org_apache_avro_avro_ipc_1_7_7_tests_jar.xml │ ├── SBT__org_apache_avro_avro_mapred_1_7_7_hadoop2_jar.xml │ ├── SBT__org_apache_commons_commons_compress_1_4_1_jar.xml │ ├── SBT__org_apache_commons_commons_crypto_1_0_0_jar.xml │ ├── SBT__org_apache_commons_commons_lang3_3_5_jar.xml │ ├── SBT__org_apache_commons_commons_math3_3_6_jar.xml │ ├── SBT__org_apache_commons_commons_math_2_1_jar.xml │ ├── SBT__org_apache_curator_curator_client_2_4_0_jar.xml │ ├── SBT__org_apache_curator_curator_framework_2_4_0_jar.xml │ ├── SBT__org_apache_curator_curator_recipes_2_4_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_annotations_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_auth_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_client_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_common_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_hdfs_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_mapreduce_client_app_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_mapreduce_client_common_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_mapreduce_client_core_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_mapreduce_client_jobclient_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_mapreduce_client_shuffle_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_yarn_api_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_yarn_client_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_yarn_common_2_2_0_jar.xml │ ├── SBT__org_apache_hadoop_hadoop_yarn_server_common_2_2_0_jar.xml │ ├── SBT__org_apache_ivy_ivy_2_4_0_jar.xml │ ├── SBT__org_apache_parquet_parquet_column_1_8_1_jar.xml │ ├── SBT__org_apache_parquet_parquet_common_1_8_1_jar.xml │ ├── SBT__org_apache_parquet_parquet_encoding_1_8_1_jar.xml │ ├── SBT__org_apache_parquet_parquet_format_2_3_0_incubating_jar.xml │ ├── SBT__org_apache_parquet_parquet_hadoop_1_8_1_jar.xml │ ├── SBT__org_apache_parquet_parquet_jackson_1_8_1_jar.xml │ ├── SBT__org_apache_spark_spark_catalyst_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_core_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_graphx_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_launcher_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_mllib_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_mllib_local_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_network_common_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_network_shuffle_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_sketch_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_sql_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_streaming_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_tags_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_spark_spark_unsafe_2_11_2_1_0_jar.xml │ ├── SBT__org_apache_xbean_xbean_asm5_shaded_4_4_jar.xml │ ├── SBT__org_apache_zookeeper_zookeeper_3_4_5_jar.xml │ ├── SBT__org_codehaus_jackson_jackson_core_asl_1_9_13_jar.xml │ ├── SBT__org_codehaus_jackson_jackson_mapper_asl_1_9_13_jar.xml │ ├── SBT__org_codehaus_janino_commons_compiler_3_0_0_jar.xml │ ├── SBT__org_codehaus_janino_janino_3_0_0_jar.xml │ ├── SBT__org_fusesource_leveldbjni_leveldbjni_all_1_8_jar.xml │ ├── SBT__org_glassfish_hk2_external_aopalliance_repackaged_2_4_0_b34_jar.xml │ ├── SBT__org_glassfish_hk2_external_javax_inject_2_4_0_b34_jar.xml │ ├── SBT__org_glassfish_hk2_hk2_api_2_4_0_b34_jar.xml │ ├── SBT__org_glassfish_hk2_hk2_locator_2_4_0_b34_jar.xml │ ├── SBT__org_glassfish_hk2_hk2_utils_2_4_0_b34_jar.xml │ ├── SBT__org_glassfish_hk2_osgi_resource_locator_1_0_1_jar.xml │ ├── SBT__org_glassfish_jersey_bundles_repackaged_jersey_guava_2_22_2_jar.xml │ ├── SBT__org_glassfish_jersey_containers_jersey_container_servlet_2_22_2_jar.xml │ ├── SBT__org_glassfish_jersey_containers_jersey_container_servlet_core_2_22_2_jar.xml │ ├── SBT__org_glassfish_jersey_core_jersey_client_2_22_2_jar.xml │ ├── SBT__org_glassfish_jersey_core_jersey_common_2_22_2_jar.xml │ ├── SBT__org_glassfish_jersey_core_jersey_server_2_22_2_jar.xml │ ├── SBT__org_glassfish_jersey_media_jersey_media_jaxb_2_22_2_jar.xml │ ├── SBT__org_javassist_javassist_3_18_1_GA_jar.xml │ ├── SBT__org_jfree_jcommon_1_0_21_jar.xml │ ├── SBT__org_jfree_jfreechart_1_0_17_jar.xml │ ├── SBT__org_jpmml_pmml_model_1_2_15_jar.xml │ ├── SBT__org_jpmml_pmml_schema_1_2_15_jar.xml │ ├── SBT__org_json4s_json4s_ast_2_11_3_2_11_jar.xml │ ├── SBT__org_json4s_json4s_core_2_11_3_2_11_jar.xml │ ├── SBT__org_json4s_json4s_jackson_2_11_3_2_11_jar.xml │ ├── SBT__org_mortbay_jetty_jetty_util_6_1_26_jar.xml │ ├── SBT__org_objenesis_objenesis_2_1_jar.xml │ ├── SBT__org_roaringbitmap_RoaringBitmap_0_5_11_jar.xml │ ├── SBT__org_scala_lang_modules_scala_parser_combinators_2_11_1_0_4_jar.xml │ ├── SBT__org_scala_lang_scala_compiler_2_11_8_jar.xml │ ├── SBT__org_scala_lang_scala_library_2_11_8_jar.xml │ ├── SBT__org_scala_lang_scala_reflect_2_11_8_jar.xml │ ├── SBT__org_scala_lang_scalap_2_11_8_jar.xml │ ├── SBT__org_scalanlp_breeze_2_11_0_12_jar.xml │ ├── SBT__org_scalanlp_breeze_macros_2_11_0_12_jar.xml │ ├── SBT__org_slf4j_jcl_over_slf4j_1_7_16_jar.xml │ ├── SBT__org_slf4j_jul_to_slf4j_1_7_16_jar.xml │ ├── SBT__org_slf4j_slf4j_api_1_7_16_jar.xml │ ├── SBT__org_slf4j_slf4j_log4j12_1_7_16_jar.xml │ ├── SBT__org_sonatype_sisu_inject_cglib_2_2_1_v20090111_jar.xml │ ├── SBT__org_spark_project_spark_unused_1_0_0_jar.xml │ ├── SBT__org_spire_math_spire_2_11_0_7_4_jar.xml │ ├── SBT__org_spire_math_spire_macros_2_11_0_7_4_jar.xml │ ├── SBT__org_tukaani_xz_1_0_jar.xml │ ├── SBT__org_xerial_snappy_snappy_java_1_1_2_6_jar.xml │ ├── SBT__oro_oro_2_0_8_jar.xml │ ├── SBT__xml_apis_xml_apis_1_3_04_jar.xml │ └── SBT__xmlenc_xmlenc_0_52_jar.xml ├── modules.xml ├── modules │ ├── scalaml_2nd_edition-build.iml │ └── scalaml_2nd_edition.iml ├── scala_compiler.xml └── vcs.xml ├── README.md ├── SourceCodeGuide.html ├── build.sbt ├── configs └── README.html ├── lib ├── CRF-1.1.jar ├── LBFGS.jar ├── Trove-3.0.2.jar ├── colt.jar └── libsvm_sml-3.18.jar ├── log4j.properties ├── models └── README.html ├── output ├── README.html └── filtering │ ├── simulated.csv │ └── smoothed.csv ├── pom.xml ├── root-doc.txt ├── scalastyle-config.xml └── src ├── main └── scala │ └── org │ └── scalaml │ ├── Predef.scala │ ├── core │ ├── ETransform.scala │ ├── ITransform.scala │ ├── design.scala │ ├── functional │ │ ├── Functor.scala │ │ ├── Monad.scala │ │ └── TensorFunctor.scala │ └── package.scala │ ├── filtering │ ├── dft │ │ ├── DFT.scala │ │ └── DFTFilter.scala │ ├── kalman │ │ └── DKalman.scala │ ├── movaverage │ │ └── MovingAverage.scala │ └── package.scala │ ├── ga │ ├── Chromosome.scala │ ├── GAConfig.scala │ ├── GASolver.scala │ ├── Gene.scala │ ├── Population.scala │ ├── Reproduction.scala │ ├── package.scala │ └── state │ │ ├── GAMonitor.scala │ │ ├── GAState.scala │ │ └── package.scala │ ├── libraries │ ├── commonsmath │ │ ├── CommonsMath.scala │ │ ├── LogisticRAdapter.scala │ │ ├── LogisticRegressionOptimizer.scala │ │ ├── MultiLinearRAdapter.scala │ │ └── RidgeRAdapter.scala │ ├── crf │ │ └── CrfAdapter.scala │ └── libsvm │ │ └── SVMAdapter.scala │ ├── plots │ ├── LinePlot.scala │ ├── Plot.scala │ ├── PlotTheme.scala │ ├── ScatterPlot.scala │ └── package.scala │ ├── reinforcement │ ├── armedbandit │ │ ├── Arm.scala │ │ ├── ArmedBandit.scala │ │ ├── CFThompsonSampling.scala │ │ ├── EGreedy.scala │ │ └── UCB1.scala │ ├── package.scala │ ├── qlearning │ │ ├── QLAction.scala │ │ ├── QLConfig.scala │ │ ├── QLPolicy.scala │ │ ├── QLSpace.scala │ │ ├── QLState.scala │ │ ├── QLearning.scala │ │ └── package.scala │ └── xcs │ │ ├── Xcs.scala │ │ ├── XcsConfig.scala │ │ ├── XcsCover.scala │ │ ├── XcsRule.scala │ │ └── package.scala │ ├── sampling │ ├── Bootstrap.scala │ ├── BoxMuller.scala │ ├── MetropolisHastings.scala │ └── MonteCarloApproximation.scala │ ├── scalability │ ├── akka │ │ ├── Controller.scala │ │ ├── Master.scala │ │ ├── MasterWithRouter.scala │ │ ├── TFutures.scala │ │ ├── TFuturesCallback.scala │ │ ├── Worker.scala │ │ ├── message │ │ │ └── Messages.scala │ │ └── package.scala │ ├── package.scala │ └── scala │ │ ├── Parallelism.scala │ │ └── package.scala │ ├── spark │ ├── SessionLifecycle.scala │ ├── extensibility │ │ └── KullbackLeibler.scala │ ├── mllib │ │ ├── Kmeans.scala │ │ ├── KmeansConfig.scala │ │ ├── RDDSource.scala │ │ └── package.scala │ ├── mlpipeline │ │ ├── CrossValidation.scala │ │ ├── DataEncoding.scala │ │ ├── ModelEstimator.scala │ │ ├── Predictor.scala │ │ ├── SimplePredictor.scala │ │ ├── ValidatedPredictor.scala │ │ ├── data │ │ │ └── DataGenerator.scala │ │ └── package.scala │ └── streaming │ │ ├── StreamingExtractor.scala │ │ └── StreamingLifeCycle.scala │ ├── stats │ ├── BiasVariance.scala │ ├── Differential.scala │ ├── Loss.scala │ ├── MinMax.scala │ ├── Stats.scala │ ├── TSeries.scala │ ├── Transpose.scala │ └── package.scala │ ├── supervised │ ├── Supervised.scala │ ├── bayes │ │ ├── BinNaiveBayesModel.scala │ │ ├── Likelihood.scala │ │ ├── MultiNaiveBayesModel.scala │ │ ├── NaiveBayes.scala │ │ ├── NaiveBayesModel.scala │ │ ├── package.scala │ │ └── text │ │ │ ├── TextAnalyzer.scala │ │ │ └── package.scala │ ├── crf │ │ ├── Crf.scala │ │ ├── CrfConfig.scala │ │ ├── CrfModel.scala │ │ └── package.scala │ ├── hmm │ │ ├── HMM.scala │ │ ├── HMMConfig.scala │ │ ├── HMMModel.scala │ │ ├── HMMTreillis.scala │ │ ├── decode │ │ │ ├── QStar.scala │ │ │ └── ViterbiPath.scala │ │ ├── eval │ │ │ ├── Alpha.scala │ │ │ └── Beta.scala │ │ ├── package.scala │ │ └── train │ │ │ ├── BaumWelchEM.scala │ │ │ ├── DiGamma.scala │ │ │ └── Gamma.scala │ ├── mlp │ │ ├── Delta.scala │ │ ├── MLP.scala │ │ ├── MLPConfig.scala │ │ ├── MLPConnection.scala │ │ ├── MLPLayer.scala │ │ ├── MLPModel.scala │ │ ├── MLPNetwork.scala │ │ └── package.scala │ ├── package.scala │ ├── regression │ │ ├── Regression.scala │ │ ├── RegressionModel.scala │ │ ├── linear │ │ │ ├── MultiLinearRegression.scala │ │ │ ├── RidgeRegression.scala │ │ │ ├── SingleLinearRegression.scala │ │ │ └── package.scala │ │ ├── logistic │ │ │ ├── LogisticBinRegression.scala │ │ │ ├── LogisticRegression.scala │ │ │ └── package.scala │ │ └── package.scala │ └── svm │ │ ├── SVM.scala │ │ ├── SVMConfig.scala │ │ ├── SVMExecution.scala │ │ ├── SVMModel.scala │ │ ├── formulation │ │ ├── SVMFormulation.scala │ │ └── package.scala │ │ ├── kernel │ │ ├── KernelMonad.scala │ │ ├── SVMKernel.scala │ │ └── package.scala │ │ └── package.scala │ ├── trading │ ├── OptionModel.scala │ ├── Signal.scala │ ├── TradingSource.scala │ ├── TradingStrategy.scala │ ├── operator │ │ └── SOperator.scala │ └── package.scala │ ├── unsupervised │ ├── Distance.scala │ ├── divergence │ │ ├── Divergence.scala │ │ └── KullbackLeibler.scala │ ├── dl │ │ ├── autoencoder │ │ │ ├── AE.scala │ │ │ ├── AEConfig.scala │ │ │ ├── AEConnection.scala │ │ │ ├── AENetwork.scala │ │ │ └── Sparsity.scala │ │ └── restrictedBoltzmann │ │ │ ├── ContrastiveDivergence.scala │ │ │ ├── RBM.scala │ │ │ ├── RBMConfig.scala │ │ │ └── SCondProb.scala │ ├── em │ │ ├── MultiVariateEM.scala │ │ └── package.scala │ ├── functionapprox │ │ ├── Bin.scala │ │ ├── DataGenerator.scala │ │ ├── FunctionApprox.scala │ │ └── HistogramApprox.scala │ ├── kmeans │ │ ├── Cluster.scala │ │ ├── KMeans.scala │ │ └── package.scala │ ├── package.scala │ └── pca │ │ ├── PCA.scala │ │ └── package.scala │ ├── util │ ├── Assertable.scala │ ├── DisplayUtils.scala │ ├── FileUtils.scala │ ├── FormatUtils.scala │ ├── LoggingUtils.scala │ ├── MapUtils.scala │ ├── MathUtils.scala │ └── package.scala │ ├── validation │ ├── BinaryValidation.scala │ ├── MulticlassValidation.scala │ ├── OneFoldValidation.scala │ └── Validation.scala │ └── workflow │ ├── Workflow.scala │ ├── data │ ├── DataSink.scala │ ├── DataSource.scala │ ├── DocumentsSource.scala │ └── package.scala │ ├── module │ ├── ClusteringModule.scala │ ├── PreprocessingModule.scala │ └── package.scala │ └── package.scala └── test ├── resources ├── data │ ├── filtering │ │ ├── AU.csv │ │ ├── BAC.csv │ │ ├── BASFY.csv │ │ ├── BBT.csv │ │ ├── BMO.csv │ │ ├── CSCO.csv │ │ ├── SPY10.csv │ │ └── SPY5.csv │ ├── reinforcement │ │ └── qlearning │ │ │ ├── IBM.csv │ │ │ ├── IBM_O.csv │ │ │ ├── ICF.csv │ │ │ ├── IWC.csv │ │ │ ├── price_o.csv │ │ │ └── rewards.csv │ ├── spark │ │ ├── CSCO.csv │ │ ├── mlpipeline_test.csv │ │ ├── mlpipeline_training.csv │ │ ├── mlpipeline_training_1.csv │ │ ├── streaming_input.csv │ │ ├── streaming_input2.csv │ │ └── validation.csv │ ├── supervised │ │ ├── bayes │ │ │ ├── AA.csv │ │ │ ├── ADM.csv │ │ │ ├── AU.csv │ │ │ ├── BAC.csv │ │ │ ├── BAC_W.csv │ │ │ ├── CSCO.csv │ │ │ ├── CSCO_W.csv │ │ │ ├── GE.csv │ │ │ ├── GE_W.csv │ │ │ ├── IBM.csv │ │ │ ├── IBM_W.csv │ │ │ ├── NEM.csv │ │ │ └── NEM_W.csv │ │ ├── crf │ │ │ ├── rating │ │ │ ├── rating.raw │ │ │ ├── rating.tagged │ │ │ ├── rating2 │ │ │ ├── rating2.raw │ │ │ └── rating2.tagged │ │ ├── hmm │ │ │ ├── obsprob.csv │ │ │ └── statesprob.csv │ │ ├── mlp │ │ │ ├── CYB.csv │ │ │ ├── FXA.csv │ │ │ ├── FXB.csv │ │ │ ├── FXC.csv │ │ │ ├── FXE.csv │ │ │ ├── FXF.csv │ │ │ ├── FXY.csv │ │ │ ├── GLD.csv │ │ │ └── SPY.csv │ │ ├── regression │ │ │ ├── CNY.csv │ │ │ ├── CSCO.csv │ │ │ ├── CSCO2.csv │ │ │ ├── CU.csv │ │ │ ├── CU_2.csv │ │ │ ├── GLD.csv │ │ │ ├── SPY.csv │ │ │ └── TLT.csv │ │ └── svm │ │ │ ├── SPY.csv │ │ │ ├── dividends.csv │ │ │ └── dividends2.csv │ └── unsupervised │ │ ├── ae │ │ ├── CYB.csv │ │ ├── FXA.csv │ │ ├── FXB.csv │ │ ├── FXC.csv │ │ ├── FXE.csv │ │ ├── FXF.csv │ │ ├── FXY.csv │ │ ├── GLD.csv │ │ └── SPY.csv │ │ ├── em │ │ ├── AA.csv │ │ ├── AAPL.csv │ │ ├── ADBE.csv │ │ ├── ADM.csv │ │ ├── ADP.csv │ │ ├── ADSK.csv │ │ ├── AET.csv │ │ ├── AFAM.csv │ │ ├── AHS.csv │ │ ├── AMZN.csv │ │ ├── AU.csv │ │ ├── AXP.csv │ │ ├── BA.csv │ │ ├── BBBY.csv │ │ ├── BBT.csv │ │ ├── BEN.csv │ │ ├── BHI.csv │ │ ├── BK.csv │ │ ├── BRCM.csv │ │ ├── BSX.csv │ │ ├── BTU.csv │ │ ├── C.csv │ │ ├── CA.csv │ │ ├── CAT.csv │ │ ├── CB.csv │ │ ├── CBS.csv │ │ ├── CCE.csv │ │ ├── CCL.csv │ │ ├── CCMP.csv │ │ ├── CELG.csv │ │ ├── CHK.csv │ │ ├── CI.csv │ │ ├── CL.csv │ │ ├── CLX.csv │ │ ├── CME.csv │ │ ├── CMG.csv │ │ ├── COH.csv │ │ ├── COP.csv │ │ ├── CSC.csv │ │ ├── CSCO.csv │ │ ├── CU.csv │ │ ├── CVS.csv │ │ ├── CVX.csv │ │ ├── CYH.csv │ │ ├── DAL.csv │ │ ├── DD.csv │ │ ├── DE.csv │ │ ├── DG.csv │ │ ├── DHI.csv │ │ ├── DNB.csv │ │ ├── DO.csv │ │ ├── DOW.csv │ │ ├── DUK.csv │ │ ├── EA.csv │ │ ├── EBAY.csv │ │ ├── EMC.csv │ │ ├── EMR.csv │ │ ├── ENTG.csv │ │ ├── ETFC.csv │ │ ├── EXC.csv │ │ ├── EXP.csv │ │ ├── EXPE.csv │ │ ├── F.csv │ │ ├── FCX.csv │ │ ├── FDO.csv │ │ ├── FDX.csv │ │ ├── FE.csv │ │ ├── FFIV.csv │ │ ├── FISV.csv │ │ ├── FITB.csv │ │ ├── FLIR.csv │ │ ├── FLR.csv │ │ ├── FLS.csv │ │ ├── FMC.csv │ │ ├── FTR.csv │ │ ├── GCI.csv │ │ ├── GE.csv │ │ ├── GLD.csv │ │ ├── GLW.csv │ │ ├── GM.csv │ │ ├── GME.csv │ │ ├── GPS.csv │ │ ├── GRMN.csv │ │ ├── GS.csv │ │ ├── GT.csv │ │ ├── HCA.csv │ │ ├── IBM.csv │ │ ├── JCI.csv │ │ ├── JCP.csv │ │ ├── JNJ.csv │ │ ├── JNPR.csv │ │ ├── JPM.csv │ │ ├── JWN.csv │ │ ├── K.csv │ │ ├── KF.csv │ │ ├── KLAC.csv │ │ ├── KMI.csv │ │ ├── KO.csv │ │ ├── KRFT.csv │ │ ├── LEN.csv │ │ ├── LH.csv │ │ ├── LINC.csv │ │ ├── LLL.csv │ │ ├── LM.csv │ │ ├── LMT.csv │ │ ├── LNC.csv │ │ ├── LO.csv │ │ ├── LRCX.csv │ │ ├── MKSI.csv │ │ ├── MSFT.csv │ │ ├── MU.csv │ │ ├── NEM.csv │ │ ├── NVMI.csv │ │ ├── QCOM.csv │ │ ├── QQQ.csv │ │ ├── SIL.csv │ │ ├── SLV.csv │ │ ├── SLW.csv │ │ ├── THC.csv │ │ ├── TRW.csv │ │ ├── TXN.csv │ │ ├── UNH.csv │ │ ├── WDC.csv │ │ ├── XLF.csv │ │ ├── XLNX.csv │ │ ├── XRT.csv │ │ └── ZNGA.csv │ │ └── kmeans │ │ ├── AA.csv │ │ ├── AAPL.csv │ │ ├── ADBE.csv │ │ ├── ADM.csv │ │ ├── ADP.csv │ │ ├── ADSK.csv │ │ ├── AET.csv │ │ ├── AFAM.csv │ │ ├── AHS.csv │ │ ├── AMZN.csv │ │ ├── AU.csv │ │ ├── AXP.csv │ │ ├── BA.csv │ │ ├── BBBY.csv │ │ ├── BBT.csv │ │ ├── BEN.csv │ │ ├── BHI.csv │ │ ├── BK.csv │ │ ├── BRCM.csv │ │ ├── BSX.csv │ │ ├── BTU.csv │ │ ├── C.csv │ │ ├── CA.csv │ │ ├── CAT.csv │ │ ├── CB.csv │ │ ├── CBS.csv │ │ ├── CCE.csv │ │ ├── CCL.csv │ │ ├── CCMP.csv │ │ ├── CELG.csv │ │ ├── CHK.csv │ │ ├── CI.csv │ │ ├── CL.csv │ │ ├── CLX.csv │ │ ├── CME.csv │ │ ├── CMG.csv │ │ ├── COH.csv │ │ ├── COP.csv │ │ ├── CSC.csv │ │ ├── CSCO.csv │ │ ├── CU.csv │ │ ├── CVS.csv │ │ ├── CVX.csv │ │ ├── CYH.csv │ │ ├── DAL.csv │ │ ├── DD.csv │ │ ├── DE.csv │ │ ├── DG.csv │ │ ├── DHI.csv │ │ ├── DNB.csv │ │ ├── DO.csv │ │ ├── DOW.csv │ │ ├── DUK.csv │ │ ├── EA.csv │ │ ├── EBAY.csv │ │ ├── EMC.csv │ │ ├── EMR.csv │ │ ├── ENTG.csv │ │ ├── ETFC.csv │ │ ├── EXC.csv │ │ ├── EXP.csv │ │ ├── EXPE.csv │ │ ├── F.csv │ │ ├── FCX.csv │ │ ├── FDO.csv │ │ ├── FDX.csv │ │ ├── FE.csv │ │ ├── FFIV.csv │ │ ├── FISV.csv │ │ ├── FITB.csv │ │ ├── FLIR.csv │ │ ├── FLR.csv │ │ ├── FLS.csv │ │ ├── FMC.csv │ │ ├── FTR.csv │ │ ├── GCI.csv │ │ ├── GE.csv │ │ ├── GLD.csv │ │ ├── GLW.csv │ │ ├── GM.csv │ │ ├── GME.csv │ │ ├── GPS.csv │ │ ├── GRMN.csv │ │ ├── GS.csv │ │ ├── GT.csv │ │ ├── HCA.csv │ │ ├── IBM.csv │ │ ├── JCI.csv │ │ ├── JCP.csv │ │ ├── JNJ.csv │ │ ├── JNPR.csv │ │ ├── JPM.csv │ │ ├── JWN.csv │ │ ├── K.csv │ │ ├── KF.csv │ │ ├── KLAC.csv │ │ ├── KMI.csv │ │ ├── KO.csv │ │ ├── KRFT.csv │ │ ├── LEN.csv │ │ ├── LH.csv │ │ ├── LINC.csv │ │ ├── LLL.csv │ │ ├── LM.csv │ │ ├── LMT.csv │ │ ├── LNC.csv │ │ ├── LO.csv │ │ ├── LRCX.csv │ │ ├── MKSI.csv │ │ ├── MSFT.csv │ │ ├── MU.csv │ │ ├── NEM.csv │ │ ├── NVMI.csv │ │ ├── QCOM.csv │ │ ├── QQQ.csv │ │ ├── SIL.csv │ │ ├── SLV.csv │ │ ├── SLW.csv │ │ ├── THC.csv │ │ ├── TRW.csv │ │ ├── TXN.csv │ │ ├── UNH.csv │ │ ├── WDC.csv │ │ ├── XLF.csv │ │ ├── XLNX.csv │ │ ├── XRT.csv │ │ └── ZNGA.csv └── text │ └── supervised │ └── bayes │ ├── input │ ├── Tesla18.txt │ ├── Tesla19.txt │ ├── Tesla20.txt │ ├── Tesla21.txt │ ├── Tesla22.txt │ ├── Tesla23.txt │ ├── Tesla24.txt │ ├── Tesla25.txt │ ├── Tesla26.txt │ ├── Tesla27.txt │ ├── Tesla28.txt │ ├── Tesla29.txt │ ├── Tesla30.txt │ ├── Tesla31.txt │ ├── Tesla32.txt │ ├── Tesla33.txt │ ├── Tesla34.txt │ ├── Tesla35.txt │ ├── Tesla36.txt │ ├── Tesla37.txt │ ├── Tesla38.txt │ ├── Tesla39.txt │ ├── Tesla40.txt │ ├── Tesla41.txt │ ├── Tesla42.txt │ ├── Tesla43.txt │ ├── Tesla44.txt │ ├── Tesla45.txt │ ├── Tesla46.txt │ ├── Tesla47.txt │ ├── Tesla48.txt │ ├── Tesla49.txt │ ├── Tesla50.txt │ ├── Tesla51.txt │ ├── Tesla52.txt │ ├── Tesla53.txt │ ├── Tesla54.txt │ ├── Tesla55.txt │ ├── Tesla56.txt │ ├── Tesla57.txt │ ├── Tesla58.txt │ ├── Tesla59.txt │ ├── Tesla60.txt │ ├── Tesla61.txt │ ├── Tesla62.txt │ ├── Tesla63.txt │ ├── Tesla64.txt │ ├── Tesla65.txt │ ├── Tesla66.txt │ ├── Tesla67.txt │ ├── tesla1.txt │ ├── tesla10.txt │ ├── tesla11.txt │ ├── tesla12.txt │ ├── tesla13.txt │ ├── tesla14.txt │ ├── tesla15.txt │ ├── tesla16.txt │ ├── tesla17.txt │ ├── tesla2.txt │ ├── tesla3.txt │ ├── tesla4.txt │ ├── tesla5.txt │ ├── tesla6.txt │ ├── tesla7.txt │ ├── tesla8.txt │ └── tesla9.txt │ └── lexicon.txt └── scala └── org └── scalaml ├── Logging.scala ├── Resource.scala ├── core └── ITransformTest.scala ├── filtering ├── dft │ └── DFTTest.scala ├── kalman │ └── DKalmanTest.scala └── movingaverage │ └── MovingAverageTest.scala ├── ga └── GATest.scala ├── reinforcement ├── armedbandit │ ├── CFThompsonSamplingTest.scala │ └── EGreedyTest.scala └── qlearning │ └── QLearningTest.scala ├── sampling ├── BootstrapTest.scala ├── BoxMullerTest.scala ├── MetropolisHastingsTest.scala └── MonteCarloApproximationTest.scala ├── scalability ├── akka │ ├── ActorManagerTest.scala │ └── TFuturesTest.scala └── scala │ ├── ParallelismTest.scala │ └── StreamsTest.scala ├── spark ├── ResourcesLoader.scala ├── extensibility │ └── KullbackLeiblerTest.scala ├── mllib │ └── KmeansTest.scala ├── mlpipeline │ └── MLPipelineTest.scala └── streaming │ └── StreamingTest.scala ├── stats ├── BiasVarianceTest.scala ├── LossTest.scala ├── MinMaxTest.scala └── StatsTest.scala ├── supervised ├── bayes │ └── NaiveBayesTest.scala ├── crf │ └── CrfTest.scala ├── hmm │ └── HmmTest.scala ├── mlp │ └── MLPTest.scala ├── regression │ ├── linear │ │ ├── MultiLinearRegressionTest.scala │ │ ├── RidgeRegressionTest.scala │ │ └── SingleLinearRegressionTest.scala │ └── logistic │ │ ├── LogBinRegressionTest.scala │ │ └── LogisticRegressionTest.scala └── svm │ └── SVMTest.scala ├── unsupervised ├── divergence │ └── KullbackLeiblerTest.scala ├── dl │ └── autoencoder │ │ └── AETest.scala ├── em │ └── EmTest.scala ├── env │ └── TestEnv.scala ├── functionapprox │ └── FunctionApproxTest.scala ├── kmeans │ └── KMeansTest.scala └── pca │ └── PCATest.scala ├── validation ├── BinaryValidationTest.scala └── OneFoldValidationTest.scala └── workflow └── WorkflowTest.scala /.idea/libraries/SBT__aopalliance_aopalliance_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_chuusai_shapeless_2_11_2_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_clearspring_analytics_stream_2_7_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_esotericsoftware_kryo_shaded_3_0_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_esotericsoftware_minlog_1_3_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_fasterxml_jackson_core_jackson_annotations_2_6_5_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_fasterxml_jackson_core_jackson_core_2_6_5_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_fasterxml_jackson_core_jackson_databind_2_6_5_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_fasterxml_jackson_module_jackson_module_paranamer_2_6_5_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_fasterxml_jackson_module_jackson_module_scala_2_11_2_6_5_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_github_fommil_netlib_core_1_1_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_github_rwl_jtransforms_2_4_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_google_code_findbugs_jsr305_1_3_9_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_google_guava_guava_14_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_google_inject_guice_3_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_google_protobuf_protobuf_java_2_5_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_ning_compress_lzf_1_0_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_thoughtworks_paranamer_paranamer_2_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_twitter_chill_2_11_0_8_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_twitter_chill_java_0_8_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_akka_akka_actor_2_11_2_3_8_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_typesafe_config_1_2_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__com_univocity_univocity_parsers_2_2_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_beanutils_commons_beanutils_1_7_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_beanutils_commons_beanutils_core_1_8_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_cli_commons_cli_1_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_codec_commons_codec_1_10_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_collections_commons_collections_3_2_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_configuration_commons_configuration_1_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_digester_commons_digester_1_8_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_httpclient_commons_httpclient_3_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_io_commons_io_2_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_lang_commons_lang_2_5_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__commons_net_commons_net_2_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__io_dropwizard_metrics_metrics_core_3_1_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__io_dropwizard_metrics_metrics_graphite_3_1_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__io_dropwizard_metrics_metrics_json_3_1_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__io_dropwizard_metrics_metrics_jvm_3_1_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__io_netty_netty_3_8_0_Final_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__io_netty_netty_all_4_0_42_Final_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__javax_annotation_javax_annotation_api_1_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__javax_inject_javax_inject_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__javax_servlet_javax_servlet_api_3_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__javax_validation_validation_api_1_1_0_Final_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__javax_ws_rs_javax_ws_rs_api_2_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__log4j_log4j_1_2_17_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_java_dev_jets3t_jets3t_0_7_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_jpountz_lz4_lz4_1_3_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_razorvine_pyrolite_4_13_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_sf_opencsv_opencsv_2_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_sf_py4j_py4j_0_10_4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__net_sourceforge_f2j_arpack_combined_all_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_antlr_antlr4_runtime_4_5_3_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_avro_avro_1_7_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_avro_avro_ipc_1_7_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_avro_avro_ipc_1_7_7_tests_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_avro_avro_mapred_1_7_7_hadoop2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_commons_commons_compress_1_4_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_commons_commons_crypto_1_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_commons_commons_lang3_3_5_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_commons_commons_math3_3_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_commons_commons_math_2_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_curator_curator_client_2_4_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_curator_curator_framework_2_4_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_curator_curator_recipes_2_4_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_annotations_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_auth_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_client_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_common_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_hdfs_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_mapreduce_client_app_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_mapreduce_client_common_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_mapreduce_client_core_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_mapreduce_client_jobclient_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_mapreduce_client_shuffle_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_yarn_api_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_yarn_client_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_yarn_common_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_hadoop_hadoop_yarn_server_common_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_ivy_ivy_2_4_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_parquet_parquet_column_1_8_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_parquet_parquet_common_1_8_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_parquet_parquet_encoding_1_8_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_parquet_parquet_format_2_3_0_incubating_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_parquet_parquet_hadoop_1_8_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_parquet_parquet_jackson_1_8_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_catalyst_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_core_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_graphx_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_launcher_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_mllib_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_mllib_local_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_network_common_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_network_shuffle_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_sketch_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_sql_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_streaming_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_tags_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_spark_spark_unsafe_2_11_2_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_xbean_xbean_asm5_shaded_4_4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_apache_zookeeper_zookeeper_3_4_5_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_codehaus_jackson_jackson_core_asl_1_9_13_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_codehaus_jackson_jackson_mapper_asl_1_9_13_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_codehaus_janino_commons_compiler_3_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_codehaus_janino_janino_3_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_fusesource_leveldbjni_leveldbjni_all_1_8_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_hk2_external_aopalliance_repackaged_2_4_0_b34_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_hk2_external_javax_inject_2_4_0_b34_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_hk2_hk2_api_2_4_0_b34_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_hk2_hk2_locator_2_4_0_b34_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_hk2_hk2_utils_2_4_0_b34_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_hk2_osgi_resource_locator_1_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_jersey_bundles_repackaged_jersey_guava_2_22_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_jersey_containers_jersey_container_servlet_2_22_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_jersey_containers_jersey_container_servlet_core_2_22_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_jersey_core_jersey_client_2_22_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_jersey_core_jersey_common_2_22_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_jersey_core_jersey_server_2_22_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_glassfish_jersey_media_jersey_media_jaxb_2_22_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_javassist_javassist_3_18_1_GA_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_jfree_jcommon_1_0_21_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_jfree_jfreechart_1_0_17_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_jpmml_pmml_model_1_2_15_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_jpmml_pmml_schema_1_2_15_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_json4s_json4s_ast_2_11_3_2_11_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_json4s_json4s_core_2_11_3_2_11_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_json4s_json4s_jackson_2_11_3_2_11_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_mortbay_jetty_jetty_util_6_1_26_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_objenesis_objenesis_2_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_roaringbitmap_RoaringBitmap_0_5_11_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_lang_modules_scala_parser_combinators_2_11_1_0_4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_lang_scala_compiler_2_11_8_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_lang_scala_library_2_11_8_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_lang_scala_reflect_2_11_8_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scala_lang_scalap_2_11_8_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scalanlp_breeze_2_11_0_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_scalanlp_breeze_macros_2_11_0_12_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_slf4j_jcl_over_slf4j_1_7_16_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_slf4j_jul_to_slf4j_1_7_16_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_slf4j_slf4j_api_1_7_16_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_slf4j_slf4j_log4j12_1_7_16_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_sonatype_sisu_inject_cglib_2_2_1_v20090111_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_spark_project_spark_unused_1_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_spire_math_spire_2_11_0_7_4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_spire_math_spire_macros_2_11_0_7_4_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_tukaani_xz_1_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__org_xerial_snappy_snappy_java_1_1_2_6_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__oro_oro_2_0_8_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__xml_apis_xml_apis_1_3_04_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/SBT__xmlenc_xmlenc_0_52_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/scala_compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SourceCodeGuide.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/SourceCodeGuide.html -------------------------------------------------------------------------------- /build.sbt: -------------------------------------------------------------------------------- 1 | organization := "Patrick Nicolas" 2 | 3 | name := "Scala for Machine Learning - 2nd Edition" 4 | 5 | version := "0.99.2" 6 | 7 | scalaVersion := "2.11.8" 8 | 9 | libraryDependencies ++= Seq( 10 | "org.apache.commons" % "commons-math3" % "3.6", 11 | "org.jfree" % "jfreechart" % "1.0.17", 12 | "com.typesafe.akka" %% "akka-actor" % "2.3.8", 13 | "org.apache.spark" %% "spark-core" % "2.1.0", 14 | "org.apache.spark" %% "spark-mllib" % "2.1.0", 15 | "org.apache.spark" %% "spark-streaming" % "2.1.0", 16 | "org.scalatest" %% "scalatest" % "2.2.6" 17 | ) 18 | 19 | // Resolver for Apache Spark framework 20 | resolvers += "Akka Repository" at "http://repo.akka.io/releases/" 21 | 22 | // Options for the Scala compiler should be customize 23 | scalacOptions ++= Seq("-unchecked", "-optimize", "-language:postfixOps") 24 | 25 | // Specifies the content for the root package used in Scaladoc 26 | scalacOptions in (Compile, doc) ++= Seq("-doc-root-content", baseDirectory.value + "/root-doc.txt") 27 | 28 | excludeFilter in doc in Compile := "*.java" || "*.jar" 29 | 30 | // Set the path to the unmanaged, 3rd party libraries 31 | unmanagedClasspath in Compile ++= Seq( 32 | file("lib/CRF-1.1.jar"), 33 | file("lib/Trove-3.0.2.jar"), 34 | file("lib/colt.jar"), 35 | file("lib/libsvm_sml-3.18.jar") 36 | ) 37 | 38 | // Options for Scala test with timing and short stack trace 39 | testOptions in Test += Tests.Argument("-oDS") 40 | 41 | // Maximum number of errors during build 42 | maxErrors := 30 43 | 44 | -------------------------------------------------------------------------------- /configs/README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Scala for Machine Learning - Algorithm Configuration Directory 4 | 5 | 6 |

Scala for Machine Learning - Configurations

7 |
8 |

9 | This directory is to be used to store (resp. load) configuration of machine algorithm, inheriting from the trait, Config into (resp. from) a file.
10 | For instance the configuration for the Multi-layer perceptron is defined by the class org.scalaml.supervised.nnet.MLPModel and can be stored into the configs/MLPModel.
11 | The persistency design is presented only for the sake of illustrating the concept and is not currently implemented for any of the machine learning algorithms. 12 | The reader is invited to create a robust, generic implementation for all the models presented in the book. 13 |

14 |

Declaration:

15 |
16 | trait Config {
17 |   protected def write(content: String): Boolean  = 
18 | 	FileUtils.write(content, Config.RELATIVE_PATH, getClass.getSimpleName)
19 |    
20 |    // Save these configuration parameters into a file configs/getClass.getSimpleName	
21 |   def >> : Boolean = false
22 | }
23 | 
24 | object Config {
25 |   private val RELATIVE_PATH = "configs/"
26 |   def read(className: String): Option[String] = FileUtils.read(RELATIVE_PATH, className)
27 | }
28 | 29 | 30 | -------------------------------------------------------------------------------- /lib/CRF-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/lib/CRF-1.1.jar -------------------------------------------------------------------------------- /lib/LBFGS.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/lib/LBFGS.jar -------------------------------------------------------------------------------- /lib/Trove-3.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/lib/Trove-3.0.2.jar -------------------------------------------------------------------------------- /lib/colt.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/lib/colt.jar -------------------------------------------------------------------------------- /lib/libsvm_sml-3.18.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/lib/libsvm_sml-3.18.jar -------------------------------------------------------------------------------- /log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=ERROR, console, file 2 | 3 | # Console logging 4 | log4j.appender.console=org.apache.log4j.ConsoleAppender 5 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n 7 | 8 | # File logging 9 | log4j.appender.file=org.apache.log4j.FileAppender 10 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.file.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n 12 | log4j.appender.file=org.apache.log4j.RollingFileAppender 13 | log4j.appender.file.File=/tmp/logs/scalaml.log 14 | log4j.appender.file.MaxFileSize=5MB 15 | log4j.appender.file.MaxBackupIndex=5 16 | 17 | # Spark and Akka settings 18 | log4j.logger.org.apache.spark=ERROR 19 | log4j.logger.Remoting=WARN 20 | -------------------------------------------------------------------------------- /output/README.html: -------------------------------------------------------------------------------- 1 | 2 | Scala for Machine Learning - Example Output Directory 3 | 4 | 5 |

Scala for Machine Learning - Output

6 |
7 | Directory for output from execution of test cases 8 | The class DataSink is responsible to write content into this directory using the |> operator 9 | 10 |

Declaration:

11 |
12 | class DataSink[T <% String](sinkName: String) {
13 |   def write(content: String): Boolean
14 |   override def |> : PartialFunction[List[XTSeries[T]], Int]
15 | }
16 | 
17 |

Usage

18 |
19 |   // Store a list of time series into a file output
20 | val output = s"output/chap3/kalman_${alpha.toString}.csv"
21 | DataSink[Double](output) |> input.foldLeft(List[XTSeries[Double]]())((sk, v) => v :: sk)
22 | 
23 |   // Store a frequencies spectrum into a file OUTPUT2
24 | private val OUTPUT2 = "output/chap3/smoothed.csv"
25 | val frequencies = DFT[Double] |> XTSeries[Double](values)
26 | DataSink[Double](OUTPUT2) write frequencies
27 | 
28 | 29 | -------------------------------------------------------------------------------- /root-doc.txt: -------------------------------------------------------------------------------- 1 |

Scala for Machine Learning - 2nd edition Version 0.99.2 API Documentation

2 | 3 |
4 | 5 | The source code in this library is provided by the author for the sole purpose of illustrating the concepts and algorithms presented in the 2nd edition of “Scala for Machine Learning" 6 |
7 | See the source code guide SourceCodeGuide.html for Scala programming style, best practice and design patterns.
8 | The implementation of algorithms in each chapter is defined in a dedicated package. The test examples are defined in src/test/scala directory.
9 |
10 |

Chapter 1: Getting Started

11 |

Chapter 2: Data Pipelines

12 |

Chapter 3: Data pre-preprocessing

13 |

Chapter 4: Unsupervised Learning

14 |

Chapter 5: Dimension Reduction

15 |

Chapter 6: Naive Bayes Classifiers

16 |

Chapter 7: Sequential data models

17 |

Chapter 8: Monte Carlo Inference

18 |

Chapter 9: Regression and regularization

19 |

Chapter 10: Multi-layer Perceptron

20 |

Chapter 11: Deep Learning

21 |

Chapter 12: Kernel Models and Support Vector Machine

22 |

Chapter 13: Evolutionary Computing

23 |

Chapter 14: Multi-armed Bandits

24 |

Chapter 15: Reinforcement Learning

25 |

Chapter 16: Parallelism with Scala and Akka

26 |

Chapter 17: Apache Spark MLlib

27 | 28 | -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/core/functional/Monad.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.core.functional 19 | 20 | import scala.language.higherKinds 21 | 22 | /** 23 | * Generic definition of a Monad used as a template for creating implicit and explicit data 24 | * transformations 25 | * @tparam M Type of the data transformation or container 26 | * @author Patrick Nicolas 27 | * @since December 21, 2013 0.98.1 28 | * @version 0.98.1 29 | * @see Scala for Machine Learning Chapter 1 Getting started / Monads and higher kinds 30 | */ 31 | trait _Monad[M[_]] { 32 | def unit[T](t: T): M[T] 33 | def map[T, U](m: M[T])(f: T => U): M[U] 34 | def flatMap[T, U](m: M[T])(f: T => M[U]): M[U] 35 | } 36 | 37 | // ------------------------------- EOF ----------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/core/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * Package defined for the core component of Scala for Machine learning. The package defines 22 | * the following components: 23 | * {{{ 24 | * - Basic matrix operations '''Matrix''' 25 | * - Types aliases and types conversion '''Types''' 26 | * - Monad for data transformation '''Monad''' 27 | * - Data transformation with explicit configuration '''ETransform''' 28 | * - Data transformation with model implicitly extracted from data '''ITransform''' 29 | * - Design pattern for classifiers '''Design.model'''and '''Design.config''' 30 | * }}} 31 | * @author Patrick Nicolas 32 | * @version 0.99.2 33 | */ 34 | package object core {} 35 | 36 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/filtering/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * This package object defines the pre-processing algorithms introduced in 22 | * Chapter 3: Data Pre-processing 23 | * - Simple moving average for smoothing, filtering input data '''SimpleMovingAverage''' 24 | * - Exponential moving average for filtering and smoothing data '''ExpMovingAverage''' 25 | * - Weighted moving average for filtering '''WeightedMovingAverage''' 26 | * - Discrete Fourier transform and series '''DFT''' 27 | * - Discrete Fourier Low pass filter '''DFTFir''' 28 | * - Kalman optimal filter '''DKalman''' 29 | * @note Scala for Machine Learning - Chapter 3 Data Pre-processing 30 | */ 31 | package object filtering {} 32 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/ga/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * This package object defines the classes that support genetic algorithms as 22 | * classifiers and optimizer introduced in Chapter 10: Genetic Algorithms 23 | * 24 | * - Genetic chromosome defined as a list of Gene with a symbolic representation of list of 25 | * predicates (variable operator value) or rule IF( value operator value) THEN ..'''Chromosome 26 | * ''' 27 | * 28 | * - Genetic Gene defined in binary format with a symbolic representation of predicates 29 | * '''Gene''' 30 | * 31 | * - Chromosome pool or population managed by genetic operator such as selection, mutation 32 | * and cross-over '''Population''' 33 | * 34 | * - Reproduction cycle (selection, cross-over, mutation with exit conditions 35 | * '''Reproduction''' 36 | * 37 | * - Genetic Algorithm solver '''GASolver''' 38 | * @see Scala for Machine Learning - Chapter 10 Genetic algorithm 39 | */ 40 | package object ga {} 41 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/ga/state/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.ga 19 | 20 | /** 21 | * This package object defines the state of the execution of genetic algorithm as a 22 | * sequence of reproduction cycle on an evolving population or chromosomes. 23 | * @note Scala for Machine Learning - Chapter 13 Evolutionary computing 24 | */ 25 | package object state {} 26 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/libraries/commonsmath/CommonsMath.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.libraries.commonsmath 19 | 20 | import scala.language.implicitConversions 21 | import org.apache.commons.math3.linear._ 22 | import org.scalaml.Predef._ 23 | 24 | /** 25 | * Implicit conversion from internal primitive types Array[Double] and DblMatrix to Apache 26 | * Commons Math types. 27 | * @author Patrick Nicolas 28 | * @since 0.98 January 23, 2014 29 | * @version 0.99.2 30 | * @see Scala for Machine Learning Chapter 3 Data pre-processing/Time series 31 | */ 32 | private[scalaml] object CommonsMath { 33 | 34 | implicit def double2RealMatrix(data: DblMatrix): RealMatrix = new Array2DRowRealMatrix(data) 35 | implicit def double2RealMatrix2(data: Array[Double]): RealMatrix = new Array2DRowRealMatrix(data) 36 | implicit def double2RealVector(data: Array[Double]): RealVector = new ArrayRealVector(data) 37 | implicit def RealVector2Double(vec: RealVector): Array[Double] = vec.toArray 38 | implicit def RealMatrix2Double(m: RealMatrix): DblMatrix = m.getData 39 | } 40 | 41 | // --------------------------- EOF ----------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/libraries/commonsmath/MultiLinearRAdapter.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.libraries.commonsmath 19 | 20 | import scala.language.implicitConversions 21 | import org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression 22 | import org.scalaml.Predef._ 23 | 24 | /** 25 | * Implicit conversion from internal primitive types Array[Double] and DblMatrix to Apache 26 | * Commons Math types. 27 | * @author Patrick Nicolas 28 | * @since January 23, 2014 0.98 29 | * @version 0.99.2 30 | * @see Scala for Machine Learning Chapter 9 Regression and regularization 31 | */ 32 | 33 | final private[scalaml] class MultiLinearRAdapter extends OLSMultipleLinearRegression { 34 | 35 | final def createModel(x: Vector[Array[Double]], y: DblVec): Unit = 36 | super.newSampleData(y.toArray, x.toArray) 37 | 38 | final def weights: Array[Double] = estimateRegressionParameters 39 | final def rss: Double = calculateResidualSumOfSquares 40 | } 41 | 42 | // --------------------------- EOF ----------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/plots/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * This package object defines the classes that wraps the jFreeChart library with default 22 | * configuration parameters. The plot supported are 23 | * 24 | * - Line plot for one or list of time series '''LinePlot''' 25 | * 26 | * - Scatter plot for two dimension time series or two single variable time series 27 | * '''ScatterPlot''' 28 | * 29 | * The configuration of the plots is defined in the class '''PlotTheme''' with two basic 30 | * themes: 31 | * 32 | * - Plot with a black background and compatible font color '''BackPlotTheme''' 33 | * 34 | * - Plot with a light grey background and compatible font color '''LightPlotTheme''' 35 | * @see jFreeChart library http://www.jfreechart.org 36 | * @see Scala for Machine Learning Chapter 1: ''Getting started'' / Libraries 37 | */ 38 | package object plots {} 39 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/reinforcement/armedbandit/ArmedBandit.scala: -------------------------------------------------------------------------------- 1 | package org.scalaml.reinforcement.armedbandit 2 | 3 | import org.scalaml.core.ITransform 4 | import scala.util.Try 5 | 6 | 7 | /** 8 | * Generic Armed bandit interface 9 | * @author Patrick Nicolas 10 | * @version 0.99.2 11 | * @tparam U Type of the arm 12 | */ 13 | private[scalaml] trait ArmedBandit[U <: Arm] extends ITransform[U, Double]{ 14 | protected[this] val arms: List[U] = List.empty[U] 15 | protected[this] var cumulRegret: Double = _ 16 | 17 | def select: U 18 | 19 | def apply(successArm: U): Unit 20 | 21 | /** 22 | * 23 | * @return A partial function that implement the conversion of data element T => Try[A] 24 | */ 25 | override def |> : PartialFunction[U, Try[Double]] = { 26 | case successArm: U @unchecked if(successArm.successes + successArm.failures > 1) => 27 | val playedArm = select 28 | this(successArm) 29 | cumulRegret += playedArm.mean - successArm.mean 30 | Try(cumulRegret) 31 | } 32 | } 33 | 34 | 35 | // ------------------------------ EOF -------------------------------------------------- 36 | -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/reinforcement/armedbandit/CFThompsonSampling.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.reinforcement.armedbandit 19 | 20 | 21 | /** 22 | * Very simple Free-context Thompson Sampling implementation 23 | * @version 0.99.2 24 | * @param arms List of arms of type bounded by BetaArm 25 | * @tparam U Type of Arm 26 | */ 27 | private[scalaml] final class CFThompsonSampling[U <: BetaArm] ( 28 | epsilon: Double, 29 | arms: List[U]) extends EGreedy[U](epsilon, arms) { 30 | import scala.util.Random._ 31 | 32 | override def select: U = if(nextDouble < epsilon) arms(nextInt(arms.size)) else arms.sortBy(_.sample).head 33 | } 34 | -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/reinforcement/armedbandit/UCB1.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.reinforcement.armedbandit 19 | 20 | import org.scalaml.core.ITransform 21 | import scala.util.Try 22 | 23 | 24 | /** 25 | * Implementation of the Upper Confidence Bounds algorithm 26 | * 27 | * @author Patrick Nicolas 28 | * @version 0.99.2 29 | * @param arms List of bandit arms 30 | * @tparam U Type of the arm 31 | */ 32 | private[scalaml] class UCB1[U <: CountedArm](override val arms: List[U]) extends ArmedBandit[U] { 33 | private[this] var numActions: Int = _ 34 | 35 | override def select: U = { 36 | numActions += 1 37 | arms.sortBy(_.score(numActions)).head 38 | } 39 | 40 | /** 41 | * Update the number of successes and failures for each arms 42 | * @param successArm Arm that has been selected and actioned upon 43 | */ 44 | override def apply(successArm: U): Unit = arms.foreach( _.apply(successArm) ) 45 | } 46 | 47 | // ------------------------- EOF ------------------------------ 48 | -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/reinforcement/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * This package object encapsulate the two reinforcement algorithms defined in Chapter 11 22 | * Reinforcement learning; 23 | * 24 | * - Q-learning iterative algorithm '''qlearning''' 25 | * 26 | * - Extended Learning Classifiers '''xcs''' 27 | * @see Scala for Machine Learning Chapter 11: ''Reinforcement learning'' 28 | */ 29 | package object reinforcement {} 30 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/reinforcement/qlearning/QLAction.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.reinforcement.qlearning 19 | 20 | /** 21 | * Class that define action between on source state and multiple 22 | * destination states. 23 | * - '''from''' Source state 24 | * - '''to''' list of destination states 25 | * @constructor Create an state transition action for the Q-learning algorithm. 26 | * @throws IllegalArgumentException if the source or destination states ir undefined. 27 | * @param from Source state in the transition (source of the action) 28 | * @param to List of destination states in the transition (target of the action) 29 | * 30 | * @author Patrick Nicolas 31 | * @since 0.98 January, 22, 2014 32 | * @version 0.99.2 33 | * @see Scala for Machine Learning Chapter 11 "Reinforcement learning" / Q-learning 34 | */ 35 | @throws(classOf[IllegalArgumentException]) 36 | private[scalaml] case class QLAction(from: Int, to: Int) { 37 | require(from >= 0, s"QLAction found from: $from required: >=0") 38 | require(to >= 0, s"QLAction found to: $to required: >=0") 39 | 40 | override def toString: String = s"\nAction: state $from => state $to" 41 | } 42 | 43 | // ---------------------------- EOF -------------------------------------------------------------- 44 | -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/reinforcement/qlearning/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.reinforcement 19 | 20 | /** 21 | * This package object encapsulates implementation of Q-learning algorithms. It is 22 | * defined by the following classes 23 | * 24 | * - State transition actions '''QLAction''' 25 | * 26 | * - Configuration parameters for the execution the Q-learning algorithm (training and 27 | * state prediction) '''QLConfig''' 28 | * 29 | * - State and its associated actions '''QLState''' 30 | * 31 | * - Search space of all states and state transitions '''QLSpace''' 32 | * 33 | * - Policy defines as the value, probability and reward matrices '''QLPolicy''' 34 | * 35 | * - Model generated through training containing the most rewarding policy and training 36 | * coverage '''QLModel''' 37 | * 38 | * - Probability and reward input to policy '''QLInput''' 39 | * 40 | * - Q-learning algorithm for the generation of the optimum policy and prediction for 41 | * next state '''QLearning''' 42 | * 43 | * @see Scala for Machine Learning Chapter 11 ''Reinforcement learning'' / Q-learning 44 | */ 45 | package object qlearning {} 46 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/reinforcement/xcs/XcsConfig.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.reinforcement.xcs 19 | 20 | import org.scalaml.ga.GAConfig 21 | import org.scalaml.reinforcement.qlearning.QLConfig 22 | import org.scalaml.core.Design.Config 23 | 24 | /** 25 | * Class that defined the configuration parameters for the XCS algorithm. 26 | * @constructor Create a configuration for the XCS algorithm 27 | * @param gaConfig Configuration of the Genetic Algorithm used in extracting the 28 | * fittest rules or classifier 29 | * @param qlConfig Configuration parameters for the Q-learning algorithm. 30 | * 31 | * @author Patrick Nicolas 32 | * @since March 22, 2014 33 | * @note Scala for Machine Learning Chapter 11 Reinforcement learning / 34 | * Extended learning classifier systems 35 | */ 36 | final protected class XcsConfig(val gaConfig: GAConfig, val qlConfig: QLConfig) extends Config 37 | 38 | // -------------------------- EOF ------------------------------------------------ -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/reinforcement/xcs/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.reinforcement 19 | 20 | /** 21 | * This package object encapsulates the skeleton for the implementation of the 22 | * extended learning classifiers (XCS) using the following classes: 23 | * 24 | * - Actions triggered following the matching and selection of the most 25 | * appropriate rules '''XcsAction''' 26 | * 27 | * - Rules defined as {predicate, action} and comprising the search space or 28 | * knowledge base '''XcsRule''' 29 | * 30 | * - Singleton to generate new rule (predicate, action) if no match for the current 31 | * state/condition (predicate) of the environment exists '''XcsCover''' 32 | * 33 | * - Sensor or input event (condition met) generated by the environment '''XcsSensor''' 34 | * 35 | * - Skeleton of the implementation of the XCS algorithm '''Xcs''' 36 | * @see Scala for Machine Learning Chapter 11 Reinforcement learning / Extended Learning 37 | * classifiers system 38 | */ 39 | package object xcs {} 40 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/scalability/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * This package object encapsulates application of Scalable frameworks described in 22 | * Scala for Machine Learning Chapter 16 - Parallelism with Scala and Akka 23 | * 24 | * - Application and performance of the Scala standard library parallel collections ''' 25 | * org.scalam.scalability.scala''' 26 | * 27 | * - Application of actors and futures using Akka framework '''org.scalam.scalability.akka''' 28 | */ 29 | package object scalability {} 30 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/scalability/scala/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.scalability 19 | 20 | /** 21 | * This package object encapsulates the evaluation of the performance of the following 22 | * Scala parallel collections: 23 | * - Parallel arrays '''ParArrayBenchmark''' 24 | * - Parallel Maps/HashMaps '''ParMapBenchmark''' 25 | * @see Scala for Machine Learning Chapter 16 Parallelism with Scala and Akka 26 | */ 27 | package object scala {} 28 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/spark/mllib/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.spark 19 | 20 | /** 21 | * This package object defines the classes used in K-means clustering using the Apache 22 | * Spark framework and MLlib machine learning library: 23 | * 24 | * - Conversion of data to Spark RDD '''RDDSource''' 25 | * 26 | * - Typical configuration of a Spark MLlib application '''KmeansConfig''' 27 | * 28 | * - Wrapper for the K-Means clustering using Apache Spark '''Kmeans''' 29 | * @see Scala for Machine Learning Chapter 17 Apache Spark MLlib 30 | */ 31 | package object mllib {} 32 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/spark/mlpipeline/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.spark 19 | 20 | /** 21 | * This package object defines the classes for encoding, training and validating a model 22 | * using Apache Spark ML pipeline 23 | * @see Scala for Machine Learning Chapter 17 Apache Spark MLlib 24 | */ 25 | package object mlpipeline {} 26 | -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/stats/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * This package object defines the classes used in basic validation and statistics used 22 | * by the machine learning algorithm presented in Scala for Machine Learning 23 | * {{{ 24 | * - Basic statistics and normalization functions '''Stats''' 25 | * - Validation and F1 measure for machine learning algorithms '''Validation''' 26 | * - Illustration of the Bias -Variance trade-off '''BiasVarianceEmulator''' 27 | * - Generic Type parameterized time series '''XTSeries''' 28 | * }}} 29 | * @author Patrick Nicolas 30 | * @since 0.99.2 31 | * @see Scala for Machine Learning Chapter 2 "Data Pipelines" / Assessing a model 32 | */ 33 | package object stats {} 34 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/Supervised.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised 19 | 20 | import scala.util.Try 21 | import org.scalaml.Predef._ 22 | import org.scalaml.core.ITransform 23 | 24 | /** 25 | * Trait that defined the interface to supervised learning algorithm. 26 | * The trait requires developers to create a validation routine for parameterized 27 | * multidimensional time series of tuple (observation, class label). 28 | * @author Patrick Nicolas 29 | * @tparam T Type of elements in the time series 30 | * @tparam V Type of element in the labeled data 31 | * @see Scala for Machine Learning 32 | * @version 0.99.2 33 | */ 34 | private[scalaml] trait Supervised[T, V] { 35 | self: ITransform[T, V] => 36 | /** 37 | * validation method for supervised learning algorithm 38 | * @param xt parameterized multidimensional time series of tuple (observation, class label) 39 | * @param expected values or index of the class that contains the true positive labels 40 | * @return F1 measure 41 | */ 42 | def validate(xt: Vector[T], expected: Vector[V]): Try[Double] 43 | def crossValidation: Option[Features] = None 44 | } 45 | 46 | // -------------------------------- EOF ------------------------------------------ -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/bayes/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised 19 | 20 | /** 21 | * This package object defines the classes used in the Naive Bayes models: 22 | * 23 | * - Binomial Naive Bayes classifier '''BinNaiveBayesModel''' 24 | * 25 | * - Multi-class Naive Bayes classifier '''MultiNaiveBayesModel''' 26 | * 27 | * - Computation of class likelihood and priors'''NaiveBayesLikelihood''' 28 | * @see Scala for Machine Learning Chapter 6 ''Naive Bayes models'' / Naive Bayes classifiers 29 | */ 30 | package object bayes {} 31 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/bayes/text/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised.bayes 19 | 20 | /** 21 | * This package object defines the application of Naive Bayes model to text mining: 22 | * 23 | * - Extraction, sorting and aggregation of news articles contained in a Corpus 24 | * '''NewsArticles''' 25 | * 26 | * - Simple computation of relative frequency of keywords in a news article '''TermsScore''' 27 | * 28 | * - Computation of class likelihood and priors'''NaiveBayesLikelihood''' 29 | * @see Scala for Machine Learning Chapter 5 ''Naive Bayes models'' / Naive Bayes and 30 | * text mining 31 | */ 32 | package object text {} 33 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/crf/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised 19 | 20 | /** 21 | * This package object contains the classes implementing the conditional random fields 22 | * for modeling sequential data using the Indian Institute of Technology, Bombay (IITB):
23 | * - Iterator to generate sequential data for the condition random field '''CrfSeqIter'''
24 | * - Configuration of the conditional random fields with L2 regularization '''CrfConfig'''
25 | * - Definition of data sequence used in training of Conditional Random fields 26 | * '''CrfTrainingSet'''
27 | * - Implementation of the Conditional Random fields using the IITB CRF library '''Crf'''
28 | * - Definition of a CRF model '''CrfModel''' 29 | * @see iitb CRF library http://sourceforge.net/projects/crf/ 30 | * @note Scala for Machine Learning Chapter 7 Sequential data models / Conditional random fields 31 | */ 32 | package object crf {} 33 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/mlp/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised 19 | 20 | /** 21 | * This package object contains the classes implementing the multi-layer perceptron 22 | * 23 | * - Typical configuration of the multi-layer perceptron as binomial, multinomial classifier 24 | * as well as regression algorithm '''MLPConfig''' 25 | * 26 | * - Definition of the objective or application of the multi-layer perceptron as binomial, 27 | * multinomial or regression model '''MLPMode''' 28 | * 29 | * - Definition of a layer (or neuron) in the multi-layer perceptron architecture'''MLPLayer''' 30 | * 31 | * - Definition of a connection between consecutive layers in the multi-layer perceptron 32 | * architecture '''MLPConnection''' 33 | * 34 | * - Model or topology with synapse weights in a multi-layer perceptron '''MLPNetwork''' 35 | * 36 | * - Implementation of the multi-layer perceptron learning algorithms '''MLP''' 37 | * @see Scala for Machine Learning Chapter 10 Multi-layer perceptron 38 | */ 39 | package object mlp {} 40 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * This package object defines the supervised learning algorithms described in Scala 22 | * for Machine Learning: 23 | * 24 | * - Naive Bayes and Graphical models '''org.scalaml.supervised.bayes''' 25 | * 26 | * - Conditional random fields as discriminative approach to sequential data 27 | * modeling '''org.scalaml.supervised.crf''' 28 | * 29 | * - Markov and Hidden Markov models as generative approach to sequential data 30 | * modeling '''org.scalaml.supervised.hmm''' 31 | * 32 | * - Artificial Neural Network and Multi-layer Perceptron '''org.scalaml.supervised.nnet''' 33 | * 34 | * - Regression models including linear regression, ordinary least squares and logistic 35 | * regression '''org.scalaml.supervised.regression''' 36 | * 37 | * - Kernel models and support vector machine classifiers and regression 38 | * '''org.scalaml.supervised.svm''' 39 | * @see Scala for Machine Learning Chapter 2 ''Data pipelines'' / Assessing a model 40 | */ 41 | package object supervised {} 42 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/regression/linear/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised.regression 19 | 20 | /** 21 | * This package object contains the classes implementing a variant of linear regression. 22 | * 23 | * - Single variate linear regression '''SingleLinearRegression''' 24 | * 25 | * - Multi variate ordinary least squares regression '''MultiLinearRegression''' 26 | * 27 | * - Linear regression with L2 penalty regularization or Ridge '''RidgeRegression''' 28 | * @see Scala for Machine Learning - Chapter 9 ''Regression and Regularization'' /Linear Regression 29 | */ 30 | package object linear {} 31 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/regression/logistic/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised.regression 19 | 20 | /** 21 | * This package object contains the classes implementing the logistic regression. 22 | * 23 | * - Simple binary logistic regression introduced in Chapter 1 '''LogisticBinRegression''' 24 | * 25 | * - Optimizer and configuration for the logistic regression 26 | * '''LogisticBinRegressionOptimizer''' 27 | * 28 | * - Generic logistic regression '''LogisticRegression''' 29 | * @see Scala for Machine Learning - Chapter 1 ''Getting started'' / Let's kick the tires 30 | * @see Scala for Machine Learning - Chapter 9 ''Regression and Regularization'' / 31 | * Logistic regression 32 | */ 33 | package object logistic {} 34 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/regression/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised 19 | 20 | /** 21 | * This package object contains the classes implementing diverse regression models. 22 | * 23 | * - Linear, Ridge and ordinary least squares regression 24 | * '''org.scalam.supervised.regression.linear''' 25 | * 26 | * - Logistic regression '''org.scalam.supervised.regression.logistic''' 27 | * @see Scala for Machine Learning Chapter 9 ''Regression and Regularization'' 28 | */ 29 | package object regression {} 30 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/svm/formulation/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised.svm 19 | 20 | /** 21 | * This package object that defines the formulation of the SVM configuration for the 22 | * LIBSVM library. The formulation support the following algorithm configuration> 23 | * 24 | * - C-SVM classifier 25 | * 26 | * - Nu-SVM classifier 27 | * 28 | * - One-SVM classifier for outliers 29 | * 30 | * - Epsilon SVM model for regression 31 | * @version 0.99.2 32 | * @see This implementation uses the LIBSVM library: 33 | * http://www.csie.ntu.edu.tw/~cjlin/libsvm/ 34 | * @see Scala for Machine Learning - Chapter 12 Kernel models and support vector machines 35 | */ 36 | package object formulation {} 37 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/svm/kernel/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised.svm 19 | 20 | /** 21 | * This package object that different kernel functions available to the support vector 22 | * machine: 23 | * 24 | * - Linear kernel 25 | * 26 | * - Radial basis function kernel 27 | * 28 | * - Polynomial kernel 29 | * 30 | * - Sigmoid kernel 31 | * 32 | * - Laplace kernel 33 | * @see This implementation uses the LIBSVM library:http://www.csie.ntu.edu.tw/~cjlin/libsvm/ 34 | * 35 | * @see Scala for Machine Learning - Chapter 8 ''Kernel models and support vector machines'' / 36 | * Kernel functions. 37 | */ 38 | package object kernel {} 39 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/supervised/svm/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.supervised 19 | 20 | /** 21 | * This package object contains the classes implementing the different kernel functions 22 | * and support vector machines for classification, outlier detection and regression 23 | * 24 | * - Typical set of configuration parameters for Support Vector Machine '''SVMConfig''' 25 | * 26 | * - Configuration parameters for the support vector machine '''SVMExecution'''< 27 | * 28 | * - Model generated through the training of support vector machine '''SVMModel''' 29 | * 30 | * - Implementation of the support vector machines using the LIBSVM library '''SVM''' 31 | * @see This implementation uses the LIBSVM library: 32 | * ''http://www.csie.ntu.edu.tw/~cjlin/libsvm/'' 33 | * @see Scala for Machine Learning - Chapter 12 ''Kernel models and support vector machines'' 34 | */ 35 | package object svm {} 36 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/trading/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * This package object that contains the constructs and tools for trading securities: 22 | * 23 | * - Progammable representation of option on securities '''OptionModel''' 24 | * 25 | * - Source for daily trading data on specific stocks for technical analysis 26 | * '''YahooFinancials''' and '''GoogleFinancials''' 27 | * 28 | * - Source for corporate data used in stock fundamental analysis '''Fundamentals''' 29 | * 30 | * - Implementation of trading signals or events '''Signal''' 31 | * 32 | * - Trading strategies as combination of signals '''TradingStrategy''' 33 | * - Automated generation of trading strategies '''StrategyFactory''' 34 | * @see Scala for Machine Learning - ''Appendix'' / Finances 101 / Technical analysis 35 | */ 36 | package object trading {} 37 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/unsupervised/divergence/Divergence.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.unsupervised.divergence 19 | 20 | /** 21 | * Generic trait for divergence (Kullback-leibler, Jensen, MI, ...) 22 | * @author Patrick Nicolas 23 | * @version 0.99.2 24 | * @see Scala for Machine Learning - Chapter 5 - Dimension Reduction / Divergences 25 | */ 26 | private[scalaml] trait Divergence { 27 | def divergence(nSteps: Int): Double 28 | } 29 | 30 | 31 | // -------------------------------- EOF ------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/unsupervised/dl/restrictedBoltzmann/RBMConfig.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.unsupervised.dl.restrictedBoltzmann 19 | 20 | 21 | /** 22 | * Data class for the configuration of the binary restricted Boltzmann machine 23 | * @author Patrick Nicolas 24 | * @version 0.99.2 25 | * 26 | * @param learningRate learning rate 27 | * @param maxIters Maximum number of iterations allowed for the unsupervised training 28 | * @param tol tolerance or convergence criteria 29 | * @param penalty penalty function to compute the cost or penalty c = f(learningRate) 30 | * @see Scala for Machine Learning Chapter 11 Deep learning/ Restricted Boltzmann Machine 31 | */ 32 | @throws(classOf[IllegalArgumentException]) 33 | case class RBMConfig( 34 | learningRate: Double, 35 | maxIters: Int, 36 | tol: Double, 37 | penalty: Double => Double) { 38 | 39 | require(maxIters > 1, s"RBM configured with $maxIters maximum iterations, require >1") 40 | final def loss: Double = penalty(learningRate) 41 | } 42 | 43 | // ---------------------------- EOF ------------------------------------------- 44 | -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/unsupervised/em/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.unsupervised 19 | 20 | /** 21 | * This package object that defines the clustering expectation-maximization (E, M Step): 22 | * 23 | * - Implementation of the Multi-variate expectation-maximization iterative algorithm 24 | * '''MultiVariateEM''' 25 | * @see Scala for Machine Learning - Chapter 4 ''Unsupervised learning'' / Clustering / 26 | * Expectation-Maximization 27 | */ 28 | package object em {} 29 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/unsupervised/functionapprox/FunctionApprox.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.unsupervised.functionapprox 19 | 20 | /** 21 | * Generic interface for the different techniques of function approximation 22 | * @version 0.99.2 23 | */ 24 | trait FunctionApprox[T] { 25 | def predict(t: T): Double 26 | } 27 | 28 | // ----------------------------- EOF --------------------------------- 29 | -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/unsupervised/kmeans/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.unsupervised 19 | 20 | /** 21 | * This package object that defines the classes implementing the K-means flat clustering 22 | * algorithm: 23 | * 24 | * - Definition of a cluster of observations used in training '''Cluster''' 25 | * 26 | * - Implementation of the K-means algorithm '''KMeans''' 27 | * @see Scala for Machine Learning - Chapter 4 ''Unsupervised learning'' / Clustering / K-means 28 | */ 29 | package object kmeans {} 30 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/unsupervised/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * This package object that introduces 3 key unsupervised learning methodologies 22 | * 23 | * - K-means clustering '''org.scalaml.unsupervised.clustering''' 24 | * 25 | * - Expectation-Maximization iterative computation '''org.scalaml.unsupervised.em''' 26 | * 27 | * - Linear method for reducing dimension (size of the feature vector) using the principal 28 | * components analysis '''org.scalaml.unsupervised.pca''' 29 | * 30 | * @see Scala for Machine Learning - Chapter 4 ''Unsupervised learning'' 31 | * Kernel functions. 32 | */ 33 | package object unsupervised {} 34 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/unsupervised/pca/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.unsupervised 19 | 20 | /** 21 | * This package object that defines the implementation of the linear reduction of 22 | * dimension, principal components analysis: 23 | * 24 | * - Implementation of the extraction of the eigenvalues and eigenvectors for a training 25 | * set as principal component analysis '''PCA''' 26 | * @see Scala for Machine Learning - Chapter 4 ''Unsupervised learning'' / Dimension reduction / 27 | * Principal components analysis 28 | */ 29 | package object pca {} 30 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/util/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | /** 21 | * This package object that defines the utilities or help classes for: 22 | * 23 | * 24 | * - Configuration of display of results on log, standard output and plots '''DisplayUtils''' 25 | * - Writing content to or reading content from a file or a directory '''FileUtils''' 26 | * - Formatting of computation results '''FormatUtils''' 27 | * - Specialized maps, counters and accumulators '''MapUtils''' 28 | */ 29 | package object util {} 30 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/workflow/data/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.workflow 19 | 20 | /** 21 | * This package object that defines the class to manage extraction of data or documents 22 | * from file as well as generation of data into file(s) 23 | * 24 | * - Source of data (file(s), or directory() using CSV format ''DataSource'' 25 | * - Source for extraction and management of documents from a Corpus ''DocumentsSource'' 26 | * - Sink of data to be store in file(s) ''DataSink'' 27 | * The sources and sink classes are implemented as data transform (PipeOperator) 28 | * @see Scala for Machine Learning - Appendix / Scala programming 29 | */ 30 | package object data {} 31 | 32 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/workflow/module/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.workflow 19 | 20 | /** 21 | * This package object that introduces two examples of workflow components using a dynamic 22 | * dependency injection: 23 | * - Dynamically configurable preprocessing module ''PreprocessingModule'' 24 | * - Dynamically configurable clustering module ''ClusteringModule'' 25 | * @see Scala for Machine Learning - Chapter 2 ''Getting started'' / Designing a workflow 26 | */ 27 | package object module 28 | 29 | // --------------------------------------- EOF ----------------------------------------- -------------------------------------------------------------------------------- /src/main/scala/org/scalaml/workflow/package.scala: -------------------------------------------------------------------------------- 1 | package org.scalaml 2 | /** 3 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 6 | * except in compliance with the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software is distributed on an 11 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * 13 | * The source code in this file is provided by the author for the sole purpose of illustrating the 14 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 15 | * ISBN: 978-1-783355-874-2 Packt Publishing. 16 | * 17 | * Version 0.99.2 18 | */ 19 | package object workflow { 20 | } -------------------------------------------------------------------------------- /src/test/resources/data/reinforcement/qlearning/IBM_O.csv: -------------------------------------------------------------------------------- 1 | IBM Call 190 Oct 18, 2 | 1.41 3 | 2.24 4 | 2.42 5 | 2.78 6 | 3.46 7 | 4.11 8 | 4.51 9 | 4.92 10 | 5.41 11 | 6.01 12 | 6.78 13 | 6.59 14 | 6.43 15 | 6.10 16 | 5.80 17 | 5.38 18 | 5.17 19 | 4.76 20 | 4.39 21 | 4.72 22 | 5.24 23 | 5.71 24 | 6.35 25 | 6.48 26 | 5.65 27 | 5.48 28 | 6.86 29 | 6.91 30 | 5.88 31 | 5.47 32 | 5.64 33 | 5.1 34 | 4.58 35 | 4.23 36 | 3.87 37 | 3.98 38 | 4.30 39 | 4.72 40 | 4.11 41 | 3.65 42 | 3.58 43 | 4.32 44 | 4.97 45 | 5.32 46 | 5.81 47 | 6.70 48 | 7.41 49 | 8.39 50 | 8.66 51 | 8.53 52 | 8.61 53 | 8.34 54 | 8.43 55 | 6.76 56 | 7.53 57 | 7.45 58 | 7.33 59 | 5.99 60 | 6.23 61 | 5.44 62 | 5.63 63 | 5.98 64 | 5.8 65 | 6.02 66 | 6.21 67 | 5.97 68 | 5.03 69 | 3.84 70 | 3.56 71 | 3.11 72 | 2.98 73 | 3.33 74 | 3.56 75 | 3.89 76 | 3.99 77 | 4.21 78 | 4.04 79 | 4.22 80 | 4.38 81 | 4.70 82 | 4.82 83 | 5.47 84 | 6.19 85 | 6.02 86 | 5.74 87 | 5.39 88 | 5.20 89 | 5.12 90 | 5.43 91 | 5.87 92 | 6.1 93 | 6.56 94 | 5.84 95 | 6.67 96 | 6.90 97 | 7.15 98 | 7.94 99 | 8.83 100 | 9.42 101 | 8.34 102 | 8.17 103 | 8.12 104 | 8.38 105 | 8.84 106 | 8.92 107 | 9.68 108 | 11.66 109 | 10.01 110 | 9.12 111 | 8.42 112 | 8.77 113 | 9.17 114 | 9.40 115 | 9.8 116 | 8.12 117 | 12.78 118 | 12.89 119 | 13.80 120 | 11.71 121 | 12.19 122 | 13.96 123 | 12.20 124 | 12.30 125 | 10.66 126 | 11.87 127 | 12.55 128 | 13.08 -------------------------------------------------------------------------------- /src/test/resources/data/spark/mlpipeline_test.csv: -------------------------------------------------------------------------------- 1 | date,asset,region,agent 2 | 07/05/2014,300ec90b,27,aa5,0.0 3 | 08/03/2014,23c9ab02,07,a08,0.0 -------------------------------------------------------------------------------- /src/test/resources/data/spark/mlpipeline_training_1.csv: -------------------------------------------------------------------------------- 1 | date,asset,region,agent,label 2 | 07/10/2014,23c9a89d,17,aa4,0.0 3 | 07/10/2014,29fe9013,12,208,0.0 4 | 07/09/2014,241ab5f9,35,4e2,1.0 5 | 11/24/2014,309ae914,02,4e2,1.0 6 | 10/18/2014,28bb005c,28,0a6,1.0 7 | 09/11/2014,300ab097,15,c72,1.0 8 | 08/03/2014,207ee09a,18,80b,1.0 9 | 09/28/2014,22000bc6,22,208,1.0 10 | 10/18/2014,2981aa92,24,80b,1.0 11 | 06/06/2014,26301ab4,26,0a6,1.0 12 | 07/05/2014,240abc81,13,aa4,0.0 13 | 09/02/2014,2101bef2,09,80b,0.0 14 | 07/09/2014,2305bce3,48,c72,1.0 15 | 11/07/2014,300ec90b,25,4e2,0.0 16 | 07/10/2014,23c9a89d,12,208,0.0 17 | 10/25/2014,2820acd8,30,0a6,1.0 18 | 09/10/2014,270c0eb1,16,208,0.0 19 | 10/01/2014,29fe9013,23,aa4,1.0 20 | 06/07/2014,28bb005c,27,c72,1.0 21 | 11/20/2014,300ab097,30,208,1.0 22 | 07/10/2014,29fe9013,12,208,0.0 23 | 07/08/2014,29fe9013,08,4e2,0.0 24 | 10/19/2014,300ec90b,40,aa4,0.0 25 | 10/25/2014,2820acd8,27,0a6,1.0 26 | 09/10/2014,270c0eb1,16,208,0.0 27 | 10/01/2014,29fe9013,23,aa4,1.0 28 | 09/28/2014,28bb005c,19,c72,1.0 29 | 08/26/2014,22000bc6,31,208,1.0 30 | 07/10/2014,29fe9013,12,208,0.0 31 | 09/20/2014,23c9a89d,13,4e2,0.0 32 | 10/06/2014,300ec90b,40,aa4,0.0 33 | 09/17/2014,300ab097,18,80b,1.0 34 | 08/23/2014,207ee09a,18,4e2,1.0 35 | 09/28/2014,22000bc6,22,208,0.0 36 | 10/08/2014,2981aa92,24,80b,0.0 37 | 06/30/2014,26301ab4,36,4e2,1.0 38 | 07/21/2014,240abc81,08,aa4,0.0 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/test/resources/data/spark/validation.csv: -------------------------------------------------------------------------------- 1 | date,asset,region,agent,label 2 | 09/11/2014,300ab097,15,c72,1.0 3 | 08/03/2014,207ee09a,18,80b,0.0 4 | 09/28/2014,22000bc6,22,208,1.0 5 | 10/18/2014,2981aa92,24,80b,1.0 6 | 06/06/2014,26301ab4,26,0a6,0.0 7 | 07/05/2014,240abc81,13,aa4,1.0 8 | -------------------------------------------------------------------------------- /src/test/resources/data/supervised/bayes/ADM.csv: -------------------------------------------------------------------------------- 1 | Date,Open,High,Low,Close,Volume,Adj Close 2 | 31-Dec-13,43.77,12,6,43.4,60,17 3 | 30-Dec-13,43.9,13,8,43.69,100,20 4 | 27-Dec-13,43.66,12,11,43.76,110,18 5 | 26-Dec-13,43.32,14,12,43.65,130,17 6 | 24-Dec-13,43.16,14,11,43.27,160,13 7 | 23-Dec-13,43.54,15,10,43.04,140,14 8 | 20-Dec-13,43.82,15,9,43.36,130,16 9 | 19-Dec-13,43.02,14,7,43.79,120,15 10 | 18-Dec-13,41.67,13,8,43.14,120,14 11 | 17-Dec-13,40.75,12,8,41.48,110,13 12 | 16-Dec-13,40.44,11,9,40.66,80,12 13 | 13-Dec-13,40.64,8,7,40.34,70,11 14 | 12-Dec-13,41.71,9,7,40.59,80,11 15 | 11-Dec-13,42.35,8,5,41.71,120,10 16 | 10-Dec-13,1,6,4,42.36,100,10 17 | -------------------------------------------------------------------------------- /src/test/resources/data/supervised/crf/rating: -------------------------------------------------------------------------------- 1 | Macquarie upgraded AUY from Neutral to Outperform rating 2 | Raymond James initiates Ainsworth Lumber as Outperform 3 | BMO Capital Markets upgrades Bear Creek Mining to Outperform 4 | Goldman Sacks adds IBM to its conviction list 5 | National Bank Financial upgraded BNS from Neutral to Outperform 6 | Analyts at CL King upgraded Crocs from Neutral to Strong Buy 7 | Schwab upgrades GE from C to B rating 8 | Schwab downgrades BAC from C to D rating 9 | TheStreet initiates Phoenix New Media as Buy 10 | Goldman Sacks adds Chevron to its conviction list 11 | Raymond James upgrades Gentiva Health Services from Underperform to Market perform 12 | Raymond James initiates Premier as Market perform 13 | Citigroup upgrades RGC from Hold to Buy 14 | Schwab upgrades MSFT from B to A rating 15 | Analyts at JP Morgan upgraded Tofutti Brands from Sell to Neutral 16 | Goldman Sacks removes FB from its conviction list 17 | TheStreet initiates Phoenix New Media as Buy 18 | Goldman Sacks removes BMY from its conviction list 19 | TheStreet upgrades AAPL from Buy to Strong Buy 20 | National Bank Financial downgraded BNCL from Neutral to Outperform 21 | BMO Capital Markets downgrades Exxon Mobil to Neutral 22 | Goldman Sacks removes DEE to its conviction list 23 | Analyts at CL King downgraded Groupon from Neutral to Sell 24 | Schwab upgrades BA from C to B rating 25 | Schwab downgrades GS from A to B rating 26 | BMO Capital Markets downgrades Valero to Sell 27 | TheStreet initiates Tesla Motors as Strong Buy 28 | Goldman Sacks adds JWM to its conviction list 29 | Raymond James downgrades JC Penney from Outperform to Market perform 30 | Citigroup downgrades ADSK from Strong Buy to Buy 31 | BMO Capital Markets downgrades Valero to Sell 32 | National Bank Financial upgraded NEM from Neutral to Outperform 33 | Analyts at CL King upgraded Macys from Buy to Strong Buy 34 | Schwab upgrades HP from B to A rating -------------------------------------------------------------------------------- /src/test/resources/data/supervised/crf/rating.raw: -------------------------------------------------------------------------------- 1 | Macquarie upgraded AUY from Neutral to Outperform rating 2 | Raymond James initiates Ainsworth Lumber as Outperform 3 | BMO Capital Markets upgrades Bear Creek Mining to Outperform 4 | Goldman Sacks adds IBM to its conviction list 5 | National Bank Financial upgraded BNS from Neutral to Outperform 6 | Analyts at CL King upgraded Crocs from Neutral to Strong Buy 7 | Schwab upgrades GE from C to B rating 8 | Schwab downgrades BAC from C to D rating 9 | TheStreet initiates Phoenix New Media as Buy 10 | Goldman Sacks adds Chevron to its conviction list 11 | Raymond James upgrades Gentiva Health Services from Underperform to Market perform 12 | Raymond James initiates Premier as Market perform 13 | Citigroup upgrades RGC from Hold to Buy 14 | Schwab upgrades MSFT from B to A rating 15 | Analyts at JP Morgan upgraded Tofutti Brands from Sell to Neutral 16 | Goldman Sacks removes FB from its conviction list 17 | TheStreet initiates Phoenix New Media as Buy 18 | Goldman Sacks removes BMY from its conviction list 19 | TheStreet upgrades AAPL from Buy to Strong Buy 20 | National Bank Financial downgraded BNCL from Neutral to Outperform 21 | BMO Capital Markets downgrades Exxon Mobil to Neutral 22 | Goldman Sacks removes DEE to its conviction list 23 | Analyts at CL King downgraded Groupon from Neutral to Sell 24 | Schwab upgrades BA from C to B rating 25 | Schwab downgrades GS from A to B rating 26 | BMO Capital Markets downgrades Valero to Sell 27 | TheStreet initiates Tesla Motors as Strong Buy 28 | Goldman Sacks adds JWM to its conviction list 29 | Raymond James downgrades JC Penney from Outperform to Market perform 30 | Citigroup downgrades ADSK from Strong Buy to Buy 31 | BMO Capital Markets downgrades Valero to Sell 32 | National Bank Financial upgraded NEM from Neutral to Outperform 33 | Analyts at CL King upgraded Macys from Buy to Strong Buy 34 | Schwab upgrades HP from B to A rating -------------------------------------------------------------------------------- /src/test/resources/data/supervised/hmm/obsprob.csv: -------------------------------------------------------------------------------- 1 | 0.59,0.41 2 | 0.46,0.54 3 | 0.38,0.62 -------------------------------------------------------------------------------- /src/test/resources/data/supervised/hmm/statesprob.csv: -------------------------------------------------------------------------------- 1 | 0.38,0.15,0.47 2 | 0.41,0.25,0.34 3 | 0.42,0.2,0.38 -------------------------------------------------------------------------------- /src/test/resources/data/supervised/regression/CSCO2.csv: -------------------------------------------------------------------------------- 1 | Date,Open,High,Low,Close,Volume,Adj Close 2 | 3/9/2011,14.78,15.08,14.20,14.91,4.79E+05,14.88 3 | 11/17/2009,10.78,10.90,10.62,10.84,3901987,10.85 4 | -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla18.txt: -------------------------------------------------------------------------------- 1 | 04.22.2014 2 | Tesla CEO Elon Musk plans to begin production in China, invest in charging infrastructure 3 | 4 | Tesla Motors Inc. CEO Elon Musk said his company will begin building cars in China within the next three to four years, and it will make a "big investment" in China's charging infrastructure, including superchargers in Beijing and Shanghai. 5 | Bloomberg reports Musk made the announcement at the Geekpark conference in Beijing, China, where Tesla is preparing to roll out deliveries of its Model S sedan. 6 | The vehicles it delivers in China, though, will be more costly for consumers than their American and European counterparts. Shipping charges, value-added taxes and import duties mean a Model S with an 85-kilowatt battery will cost about $118,000 compared to the $71,000 it costs in the U.S. 7 | Producing the cars locally means Tesla can sidestep some of these costs, like China's 25 percent import tariff. China, the world's largest auto market, is lagging in its target of hitting 5 million alternative energy-powered vehicles by 2020, according to Bloomberg. -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla23.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla23.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla25.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla25.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla26.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla26.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla27.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla27.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla28.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla28.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla29.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla29.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla30.txt: -------------------------------------------------------------------------------- 1 | 04.09.2014 2 | 3 | Tesla - 20 Key Risks That Longs Are Ignoring 4 | 5 | With a market cap approaching $27,000,000,000, Tesla (TSLA) is priced to perfection. Anyone who believes that Tesla is a buy or a hold at these levels must believe that Tesla is coated with Teflon and will execute its business plan flawlessly forever with little in the way of competition; in short, that nothing bad can ever happen to the company. While any investment requires a certain degree of faith, blind faith in any stock is usually a recipe for disaster. Set forth below are 20 key risks to Tesla's current stock valuation that I believe Tesla longs have not fully appreciated (if at all). If and when the market absorbs the fact that these (and other) risks actually exist for Tesla, I believe that Tesla's market valuation will be repriced much lower. 6 | 7 | 1. Tesla is Overvalued Using any Reasonable Valuation Metric 8 | 9 | Analysis: CEO Elon Musk admitted several months ago that the "stock price that [Tesla has] is more than we have any right to deserve." At the time, the stock price was approximately $40 below the current price. When the CEO of a public company makes an openly bearish comment regarding his or her own company or industry, longs should sit up and take notice, as this is quite a rare occurrence. While such candor should be commended, it does not bode well for Tesla's stock price. As regards Musk's bearish commentary, Tesla longs appear to have adopted the ostrich approach, pretending as if Musk never said this. An analogous situation occurred in mid-2011, when shipper Frontline's (FRO) chairman and largest shareholder was quoted as being unambiguously bearish regarding his own industry. Since then, FRO's market capitalization has plummeted over 70%. -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla31.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla31.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla32.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla32.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla33.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla33.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla34.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla34.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla37.txt: -------------------------------------------------------------------------------- 1 | 04.11.2014 2 | 3 | Tesla Hits Back at Lemon Lawyer - Analyst Blog 4 | 5 | Tesla Motors, Inc. ( TSLA ) has hit back at a lemon law claim filed by a lawyer against it for allegedly ignoring his client's three requests to buy back the car. The client reportedly faced problems with the door handle and fuse of his Model S multiple times. He claims that Tesla failed to address the problems and hence he wants to return his car. 6 | 7 | Tesla however contends that it only received one request for buying back the car. Moreover, the automaker claims that it did everything possible to redress the customer's grievances and is still striving to do so. 8 | 9 | Tesla replaced the door handles of the car even though it failed to recreate the alleged problem in them. Even that did not solve the problem according to the customer. 10 | 11 | Regarding the problem with the fuse, Tesla detected that the front trunk of the car, which provides access to the fuse, had been opened each time before the fuse blew. This indicates the possibility of fuse tampering. In fact, the electric carmaker revealed that the fuse problem was solved once its service team put a non-tamper tape on the fuse switch. Moreover, Tesla's engineers did not find any problem with the car that might have caused the fuse to blow. 12 | 13 | Tesla also mentioned that the same customer and the same lawyer had filed a lemon lawsuit against Volvo last year. While this does not prove anything, it is definitely cause for suspicion. 14 | 15 | It is worth noting that Model S scored 99 out of 100 in a consumer satisfaction survey by the Consumer Reports magazine. This is the highest score in the last few years. Results are based on the response of 350,000 Consumer Reports subscribers who own a car. More than 600 of them were owners of the 2012 or 2013 versions of Model S. 16 | 17 | Read more: http://www.nasdaq.com/article/tesla-hits-back-at-lemon-lawyer-analyst-blog-cm343760#ixzz2zk1WMN00 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla38.txt: -------------------------------------------------------------------------------- 1 | 04.09.2014 2 | 3 | Tesla Offers Lease Option to Buyers - Analyst Blog 4 | 5 | Tesla Motors, Inc. ( TSLA ) is now offering a lease option to business owners for buying Model S. The automaker has started a subsidiary, Tesla Finance, for this purpose. 6 | The company has tried to make the process of obtaining the lease as simple as possible. First of all, it has kept the lease agreement short and simple. Moreover, Tesla's website calculates the monthly lease cost for the buyer while an order is being placed for a car. 7 | 8 | The best part is that the lease agreement can be signed electronically, thus making it a very hassle-free process. Customers simply have to tap a button on the touch screen of their Tesla car, on delivery, to sign the agreement. 9 | 10 | The news was appreciated by consumers, with many positive comments posted on Tesla's website. Moreover, the stock, which had been falling recently, gained 3.83% on Tuesday after the news was made public. 11 | 12 | The ease of obtaining the lease will likely make it a popular option among business owners as they can deduct the payment from their business taxes as well. In fact, Tesla has started the leasing option on the request of many small and medium-sized business owners. 13 | 14 | Apart from the leasing option, Tesla also has banking partners who offer car loans to consumers. Moreover, the electric carmaker also offers a Resale Value Guarantee (RVG) to car owners who opt for financing with Tesla, which means that the company will provide guarantee for the highest residual value of any high volume premium sedan brand (Audi, BMW, Mercedes or Lexus) after three years of ownership. According to the company, the combination of car loan and RVG is similar to obtaining lease financing. 15 | 16 | Read more: http://www.nasdaq.com/article/tesla-offers-lease-option-to-buyers-analyst-blog-cm342785#ixzz2zk21fKFi 17 | -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla39.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla39.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla41.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla41.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla42.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla42.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla44.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla44.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla47.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla47.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla50.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla50.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla51.txt: -------------------------------------------------------------------------------- 1 | 04.21.2014 2 | 3 | Arizona Opens Door for Tesla 4 | 5 | After facing sales restriction in New Jersey and Ohio, doors opened for Tesla Motors, Inc. ( TSLA ) in Arizona. According to a bill approved by the Senate committee of Arizona, Tesla will be allowed to directly sell its vehicles in the state without any dealer network. 6 | 7 | However, the House Bill 2123 supporting direct sales of Tesla, has been opposed by the traditional auto manufacturers and dealers. They believe that this will adversely affect consumers' interest if the company goes bankrupt. 8 | 9 | However, the Senate believes that this bill will simplify the process of vehicle purchase. Tesla has a showroom in Scottsdale, which only displays vehicles but is not allowed to sell under a 2000 law. Thus, Tesla is only able to sell in the state through online orders. This, to some extent, hampers the sales of the company. 10 | 11 | Recently, Tesla faced licensing problem in setting up additional direct-sales galleries in Ohio. The issue will impede Tesla's expansion in Ohio, eventually affecting its presence in the state. The implementation of the new law will not only mar the company's results but will also affect customers. The law was supported by the argument that dealers play an important role, which is lost in case of direct sales. Dealers take care of warranty, recall and other service-related issues with the manufacturer for the customers. 12 | 13 | The new regulations approved recently in New Jersey also ban the direct sales of vehicles by any automaker and necessitate the use of middlemen. Thus, Tesla's sales will be restricted in New Jersey and its existing retail licenses will be cancelled. The automaker faces sales restriction in New Arizona and Texas as well. These two states have also banned direct selling of cars by Tesla. 14 | 15 | Read more: http://www.nasdaq.com/article/arizona-opens-door-for-tesla-analyst-blog-cm337105#ixzz2zk77aOih 16 | -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla58.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla58.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla61.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/Tesla61.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/Tesla62.txt: -------------------------------------------------------------------------------- 1 | 03.05.2014 2 | 3 | Tesla to Enhance Presence in Europe 4 | 5 | 6 | At the Geneva Motor Show, Tesla Motors, Inc. ( TSLA ) announced its plan to expand its business in Europe through an extended Supercharger network, more service centers and increased number of stores. The automaker will be opening around 30 new service centers and stores across the continent. 7 | 8 | Tesla is focused on expanding its network of Supercharger stations. At present, the automaker has 78 Superchargers in North America and 14 in Europe. Tesla intends to establish an extensive network across Europe, which will facilitate long distance travel, by end-2014. 9 | 10 | In Jan 2014, Tesla announced the opening of new Supercharger locations which connect the Netherlands, Germany, Switzerland and Austria. Tesla's Superchargers provide 120 kilowatts of DC (Direct Current) to Model S batteries using special cables. They can restore half the battery charge in just 20 minutes and full charging takes only 75 minutes, while normal charging stations take as much as 9 hours for a full charge. This reflects the time saving attribute of the chargers. 11 | 12 | Europe is an important market for Tesla. The automaker is actively undertaking international expansion, particularly in Europe and Asia, to boost sales. The company started the delivery of the Model S in Europe in Aug 2013. 13 | 14 | Tesla expects sales in Europe and Asia to be double the sales in North America by the end of 2014. The company will be launching the right hand drive version of Model S to improve sales in Europe. Moreover, Tesla will provide leasing and financing options to boost sales in the continent. 15 | 16 | Model S is widely appreciated in Europe and was recognized as the Car of the Year in Sweden, Norway and Denmark. It was also considered the Most Stylish Car in Switzerland. 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla10.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla10.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla11.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla11.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla12.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla12.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla13.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla13.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla15.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla15.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla16.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla16.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla17.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla17.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla4.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla4.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla5.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla5.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla6.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla6.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla7.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla7.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla8.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla8.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/input/tesla9.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prnicolas/ScalaML_2nd_Edition/169c199e8298fadc27650dd2fca85dfd14466dc7/src/test/resources/text/supervised/bayes/input/tesla9.txt -------------------------------------------------------------------------------- /src/test/resources/text/supervised/bayes/lexicon.txt: -------------------------------------------------------------------------------- 1 | China,China 2 | china,China 3 | chinese,China 4 | Chinese,China 5 | Beijing,China 6 | Shanghai,China 7 | Elon Musk,Musk 8 | Elon,Musk 9 | Battery,Battery 10 | battery,Battery 11 | batteries,Battery 12 | charger,Battery 13 | Supercharger,Battery 14 | stations,Battery 15 | station,Battery 16 | charge,Battery 17 | Gigafactor,Battery 18 | Model S,TSLA 19 | Model X,TSLA 20 | TSLA,TSLA 21 | Tesla Motors,TSLA 22 | Tesla,TSLA 23 | tesla,TSLA 24 | Tesla's,TSLA 25 | Upside,Upside 26 | upside,Upside 27 | upbeat,Upside 28 | positive,Upside 29 | boost,Upside 30 | bullish,Upside 31 | accelerate,Upside 32 | positives,Upside 33 | lucrative,Upside 34 | expand,Upside 35 | undervalued,Upside 36 | opportunity,Upside 37 | overperform,Upside 38 | turn positive,Upside 39 | reduce costs,Upside 40 | cost reduction,Upside 41 | increase revenue,Upside 42 | success,Upside 43 | safer,Upside 44 | low valuation,Upside 45 | winning,Upside 46 | potential,Upside 47 | Downside,Downside 48 | downside,Downside 49 | problem,Downside 50 | negative,Downside 51 | negatives,Downside 52 | overvalued,Downside 53 | risk,Downside 54 | risks,Downside 55 | risky,Downside 56 | issues,Downside 57 | overpriced,Downside 58 | unrealistic,Downside 59 | expensive,Downside 60 | excessive,Downside 61 | debt,Downside 62 | contract,Downside 63 | delays,Downside 64 | downturn,Downside 65 | short interest,Downside 66 | bearish,Downside 67 | high valuation,Downside 68 | defects,Downside 69 | underperform,Downside 70 | -------------------------------------------------------------------------------- /src/test/scala/org/scalaml/Logging.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | import org.apache.log4j.Logger 21 | import org.scalaml.util.DisplayUtils 22 | 23 | private[scalaml] trait Logging { 24 | protected[this] val name: String 25 | protected[this] lazy val logger: Logger = Logger.getLogger(s"$name") 26 | 27 | protected def show(description: String): Int = DisplayUtils.show(s"$name $description", logger) 28 | 29 | protected def error(description: String): Int = DisplayUtils.error(s"$name $description", logger) 30 | 31 | protected def error(description: String, e: Throwable): Int = { 32 | DisplayUtils.error(s"$name $description", logger, e) 33 | 0 34 | } 35 | 36 | protected def none(description: String): Option[Int] = DisplayUtils.none(s"$name $description", logger) 37 | 38 | /** 39 | * Handler for MatchErr exception thrown by Partial Functions. 40 | */ 41 | protected def failureHandler(e: Throwable): Int = 42 | if (e.getMessage != null) error(s"$name ${e.getMessage} caused by ${e.getCause.toString}") 43 | else error(s"$name ${e.toString}") 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/test/scala/org/scalaml/Resource.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml 19 | 20 | import scala.util.Try 21 | 22 | /** 23 | * Generic trait to manage resources, files used in unit tests 24 | * @version 0.99.2 25 | */ 26 | private[scalaml] trait Resource { 27 | final val resPath = "/data/" 28 | final val textPath = "/text/" 29 | 30 | final def getPath(fileName: String): Try[String] = Try(getClass().getResource(s"${resPath}$fileName").getPath) 31 | final def getTextPath(fileName: String): Try[String] = Try(getClass().getResource(s"${textPath}$fileName").getPath) 32 | 33 | } 34 | 35 | 36 | // -------------------------------- EOF ------------------------------------------------- 37 | -------------------------------------------------------------------------------- /src/test/scala/org/scalaml/sampling/BoxMullerTest.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.sampling 19 | 20 | import org.scalaml.Logging 21 | import org.scalatest.{FlatSpec, Matchers} 22 | 23 | /** 24 | * Unit test for the Box-Muller sampling generator 25 | */ 26 | final class BoxMullerTest extends FlatSpec with Matchers with Logging { 27 | protected val name = "Box-Muller sampler" 28 | 29 | it should s"$name generation of Gaussian distribution" in { 30 | show(s"$name generation of Gaussian distribution") 31 | 32 | val bm = new BoxMuller() 33 | 34 | val len = 100000 35 | val distribution = Array.fill(len)( bm.nextDouble ) 36 | val mean = distribution.reduce(_ + _)/distribution.length 37 | show(s"$name mean $mean") 38 | Math.abs(mean) < 0.01 should be (true) 39 | 40 | val stdDev = distribution./:(0.0)( (s, x) => s + (x - mean)*(x -mean))/distribution.length 41 | show(s"$name standard deviation $stdDev") 42 | Math.abs(stdDev - 1.0) < 0.01 should be (true) 43 | } 44 | 45 | } 46 | 47 | 48 | // --------------------------- EOF ------------------------------------------------ -------------------------------------------------------------------------------- /src/test/scala/org/scalaml/spark/ResourcesLoader.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.spark 19 | 20 | import org.apache.spark.sql.DataFrame 21 | 22 | sealed trait Extractor { 23 | protected[this] val delimiter: String 24 | def extract(line: String): Array[String] 25 | } 26 | 27 | /** 28 | * CSV extractor for loader 29 | */ 30 | final class CSVExtractor extends Extractor { 31 | override protected[this] val delimiter: String = "," 32 | override def extract(line: String): Array[String] = line.split(delimiter) 33 | } 34 | 35 | private[spark] object ResourcesLoader { 36 | import scala.io.Source 37 | 38 | type FieldsSet = Iterator[Array[String]] 39 | final def loadFromLocal(filename: String, extractor: Extractor): FieldsSet = { 40 | val src = Source.fromFile(filename) 41 | val lines = src.getLines().map(extractor.extract(_)) 42 | src.close() 43 | lines 44 | } 45 | 46 | final def loadFromHDFS(pathname: String)(implicit sessionLifeCycle: SessionLifeCycle): DataFrame = { 47 | import sessionLifeCycle.sparkSession.implicits._ 48 | sessionLifeCycle.sparkContext.textFile(pathname).toDF 49 | } 50 | 51 | final def getPath(filename: String): Option[String] = Option(getClass.getResource(filename).getPath) 52 | } 53 | 54 | -------------------------------------------------------------------------------- /src/test/scala/org/scalaml/unsupervised/env/TestEnv.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2013-2017 Patrick Nicolas - Scala for Machine Learning - All rights reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License") you may not use this file 5 | * except in compliance with the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software is distributed on an 10 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * 12 | * The source code in this file is provided by the author for the sole purpose of illustrating the 13 | * concepts and algorithms presented in "Scala for Machine Learning 2nd edition". 14 | * ISBN: 978-1-783355-874-2 Packt Publishing. 15 | * 16 | * Version 0.99.2 17 | */ 18 | package org.scalaml.unsupervised.env 19 | 20 | import org.scalaml.trading.YahooFinancials 21 | import org.scalaml.workflow.data.DataSource 22 | 23 | /** 24 | * Define the testing environment 25 | */ 26 | trait TestEnv { 27 | protected val extractor: List[Array[String] => Double] = YahooFinancials.adjClose :: List[Array[String] => Double]() 28 | protected def symbolFiles(path: String) = DataSource.listSymbolFiles(path) 29 | } 30 | 31 | // ----------------------- EOF -------------------------------------- 32 | --------------------------------------------------------------------------------