- Machine Learning with Scala Quick Start Guide
- Md. Rezaul Karim
- 129字
- 2021-06-24 14:32:03
Configuring the programming environment
I am assuming that Java is already installed on your machine and JAVA_HOME is set too. Also, I'm assuming that your IDE has the Maven plugin installed. If so, then just create a Maven project and add the project properties as follows:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<jdk.version>1.8</jdk.version>
<spark.version>2.3.0</spark.version>
</properties>
In the preceding properties tag, I specified the Spark version (that is, 2.3.0), but you can adjust it. Then add the following dependencies in the pom.xml file:
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_2.11</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-graphx_2.11</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-yarn_2.11</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-network-shuffle_2.11</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming-flume_2.11</artifactId>
<version>${spark.version}</version>
</dependency>
<dependency>
<groupId>com.databricks</groupId>
<artifactId>spark-csv_2.11</artifactId>
<version>1.3.0</version>
</dependency>
</dependencies>
Then, if everything goes smoothly, all the JAR files will be downloaded in the project home as Maven dependencies. Alright! Then we can start writing the code.
推薦閱讀
- Clojure Data Analysis Cookbook
- Hands-On Deep Learning with Apache Spark
- 大數據管理系統
- 火格局的時空變異及其在電網防火中的應用
- Mastercam 2017數控加工自動編程經典實例(第4版)
- 并行數據挖掘及性能優化:關聯規則與數據相關性分析
- 機器人創新實訓教程
- Maya極速引擎:材質篇
- OpenStack Cloud Computing Cookbook(Second Edition)
- 愛犯錯的智能體
- 在實戰中成長:Windows Forms開發之路
- Spatial Analytics with ArcGIS
- Linux Shell Scripting Cookbook(Third Edition)
- 筆記本電腦使用與維護
- 實戰Windows Azure