apache spark (in java) machine learning com.github.fommil.netlib.F2jBLAS.dscal(F2jBLAS.java:176) errorIs Java “pass-by-reference” or “pass-by-value”?Does a finally block always get executed in Java?“implements Runnable” vs “extends Thread” in JavaHow to get an enum value from a string value in Java?How do I determine whether an array contains a particular value in Java?How do I convert a String to an int in Java?Creating a memory leak with JavaWhat exactly is Apache Camel?Build order of Maven multimodule project?Migrating existing jersey postgres app to spring boot

Why should I use a big powerstone instead of smaller ones?

Why did the United States not resort to nuclear weapons in Vietnam?

How do I respond appropriately to an overseas company that obtained a visa for me without hiring me?

mv Command Deleted Files In Source Directory and Target Directory

If I buy and download a game through second Nintendo account do I own it on my main account too?

Best Ergonomic Design for a handheld ranged weapon

Security measures that could plausibly last 150+ years?

How to trick a fairly simplistic kill-counter?

Is this mechanically safe?

A coworker mumbles to herself when working. How can I ask her to stop?

Can the additional attack from a Samurai fighter's Rapid Strike feature be made at advantage?

What is my clock telling me to do?

What is the most 'environmentally friendly' way to learn to fly?

Is this popular optical illusion made of a grey-scale image with coloured lines?

How does Asimov's second law deal with contradictory orders from different people?

A game of red and black

Skipping same old introductions

PI 4 screen rotation from the terminal

How do I find SFDX CLI default installation folder on Mac?

How does one get a visa to go to Saudi Arabia?

Reasons for using monsters as bioweapons

The grades of the students in a class

"DDoouubbllee ssppeeaakk!!"

Is it moral to remove/hide certain parts of a photo, as a photographer?



apache spark (in java) machine learning com.github.fommil.netlib.F2jBLAS.dscal(F2jBLAS.java:176) error


Is Java “pass-by-reference” or “pass-by-value”?Does a finally block always get executed in Java?“implements Runnable” vs “extends Thread” in JavaHow to get an enum value from a string value in Java?How do I determine whether an array contains a particular value in Java?How do I convert a String to an int in Java?Creating a memory leak with JavaWhat exactly is Apache Camel?Build order of Maven multimodule project?Migrating existing jersey postgres app to spring boot






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















In java, I want to use the apache spark machine learning library and used sample code from https://spark.apache.org/docs/2.2.0/ml-pipeline.html to use a classifier to fit/ train data and predict on testing data.
But I cannot fit the classifier without a class def not found error.




SparkSession spk = SparkSession.builder().appName("dectreetennis").getOrCreate();

List<Row> dataTraining = Arrays.asList(
RowFactory.create(1.0, Vectors.dense(0.0, 1.1, 0.1)),
RowFactory.create(0.0, Vectors.dense(2.0, 1.0, -1.0)),
RowFactory.create(0.0, Vectors.dense(2.0, 1.3, 1.0)),
RowFactory.create(1.0, Vectors.dense(0.0, 1.2, -0.5))
);

StructType schema = new StructType(new StructField[]
new StructField("activity", DataTypes.DoubleType, false, Metadata.empty()),
new StructField("features", new VectorUDT(), false, Metadata.empty())
);

Dataset<Row> training1 = spk.createDataFrame(dataTraining, schema);

LogisticRegression lr = new LogisticRegression();

System.out.println("LogisticRegression parameters:n" + lr.explainParams() + "n");

lr.setMaxIter(10).setRegParam(0.01);

LogisticRegressionModel model1 = lr.fit(training1);


Here is the contents of the pom file:



<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>javaspark</groupId>
<artifactId>javaspark</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_2.11</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>com.github.fommil.netlib</groupId>
<artifactId>all</artifactId>
<version>1.1.2</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>


I get the following:



Exception in thread "main" java.lang.NoClassDefFoundError: org/netlib/blas/Dscal



at com.github.fommil.netlib.F2jBLAS.dscal(F2jBLAS.java:176)
at org.apache.spark.ml.linalg.BLAS$.scal(BLAS.scala:223)
at org.apache.spark.ml.classification.LogisticAggregator.gradient(LogisticRegression.scala:1069)










share|improve this question


























  • You might need to define f2j dependency as well as netlib is declared pom-only

    – ollik1
    Mar 27 at 6:25

















0















In java, I want to use the apache spark machine learning library and used sample code from https://spark.apache.org/docs/2.2.0/ml-pipeline.html to use a classifier to fit/ train data and predict on testing data.
But I cannot fit the classifier without a class def not found error.




SparkSession spk = SparkSession.builder().appName("dectreetennis").getOrCreate();

List<Row> dataTraining = Arrays.asList(
RowFactory.create(1.0, Vectors.dense(0.0, 1.1, 0.1)),
RowFactory.create(0.0, Vectors.dense(2.0, 1.0, -1.0)),
RowFactory.create(0.0, Vectors.dense(2.0, 1.3, 1.0)),
RowFactory.create(1.0, Vectors.dense(0.0, 1.2, -0.5))
);

StructType schema = new StructType(new StructField[]
new StructField("activity", DataTypes.DoubleType, false, Metadata.empty()),
new StructField("features", new VectorUDT(), false, Metadata.empty())
);

Dataset<Row> training1 = spk.createDataFrame(dataTraining, schema);

LogisticRegression lr = new LogisticRegression();

System.out.println("LogisticRegression parameters:n" + lr.explainParams() + "n");

lr.setMaxIter(10).setRegParam(0.01);

LogisticRegressionModel model1 = lr.fit(training1);


Here is the contents of the pom file:



<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>javaspark</groupId>
<artifactId>javaspark</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_2.11</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>com.github.fommil.netlib</groupId>
<artifactId>all</artifactId>
<version>1.1.2</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>


I get the following:



Exception in thread "main" java.lang.NoClassDefFoundError: org/netlib/blas/Dscal



at com.github.fommil.netlib.F2jBLAS.dscal(F2jBLAS.java:176)
at org.apache.spark.ml.linalg.BLAS$.scal(BLAS.scala:223)
at org.apache.spark.ml.classification.LogisticAggregator.gradient(LogisticRegression.scala:1069)










share|improve this question


























  • You might need to define f2j dependency as well as netlib is declared pom-only

    – ollik1
    Mar 27 at 6:25













0












0








0








In java, I want to use the apache spark machine learning library and used sample code from https://spark.apache.org/docs/2.2.0/ml-pipeline.html to use a classifier to fit/ train data and predict on testing data.
But I cannot fit the classifier without a class def not found error.




SparkSession spk = SparkSession.builder().appName("dectreetennis").getOrCreate();

List<Row> dataTraining = Arrays.asList(
RowFactory.create(1.0, Vectors.dense(0.0, 1.1, 0.1)),
RowFactory.create(0.0, Vectors.dense(2.0, 1.0, -1.0)),
RowFactory.create(0.0, Vectors.dense(2.0, 1.3, 1.0)),
RowFactory.create(1.0, Vectors.dense(0.0, 1.2, -0.5))
);

StructType schema = new StructType(new StructField[]
new StructField("activity", DataTypes.DoubleType, false, Metadata.empty()),
new StructField("features", new VectorUDT(), false, Metadata.empty())
);

Dataset<Row> training1 = spk.createDataFrame(dataTraining, schema);

LogisticRegression lr = new LogisticRegression();

System.out.println("LogisticRegression parameters:n" + lr.explainParams() + "n");

lr.setMaxIter(10).setRegParam(0.01);

LogisticRegressionModel model1 = lr.fit(training1);


Here is the contents of the pom file:



<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>javaspark</groupId>
<artifactId>javaspark</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_2.11</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>com.github.fommil.netlib</groupId>
<artifactId>all</artifactId>
<version>1.1.2</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>


I get the following:



Exception in thread "main" java.lang.NoClassDefFoundError: org/netlib/blas/Dscal



at com.github.fommil.netlib.F2jBLAS.dscal(F2jBLAS.java:176)
at org.apache.spark.ml.linalg.BLAS$.scal(BLAS.scala:223)
at org.apache.spark.ml.classification.LogisticAggregator.gradient(LogisticRegression.scala:1069)










share|improve this question
















In java, I want to use the apache spark machine learning library and used sample code from https://spark.apache.org/docs/2.2.0/ml-pipeline.html to use a classifier to fit/ train data and predict on testing data.
But I cannot fit the classifier without a class def not found error.




SparkSession spk = SparkSession.builder().appName("dectreetennis").getOrCreate();

List<Row> dataTraining = Arrays.asList(
RowFactory.create(1.0, Vectors.dense(0.0, 1.1, 0.1)),
RowFactory.create(0.0, Vectors.dense(2.0, 1.0, -1.0)),
RowFactory.create(0.0, Vectors.dense(2.0, 1.3, 1.0)),
RowFactory.create(1.0, Vectors.dense(0.0, 1.2, -0.5))
);

StructType schema = new StructType(new StructField[]
new StructField("activity", DataTypes.DoubleType, false, Metadata.empty()),
new StructField("features", new VectorUDT(), false, Metadata.empty())
);

Dataset<Row> training1 = spk.createDataFrame(dataTraining, schema);

LogisticRegression lr = new LogisticRegression();

System.out.println("LogisticRegression parameters:n" + lr.explainParams() + "n");

lr.setMaxIter(10).setRegParam(0.01);

LogisticRegressionModel model1 = lr.fit(training1);


Here is the contents of the pom file:



<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>javaspark</groupId>
<artifactId>javaspark</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-mllib_2.11</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>com.github.fommil.netlib</groupId>
<artifactId>all</artifactId>
<version>1.1.2</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>


I get the following:



Exception in thread "main" java.lang.NoClassDefFoundError: org/netlib/blas/Dscal



at com.github.fommil.netlib.F2jBLAS.dscal(F2jBLAS.java:176)
at org.apache.spark.ml.linalg.BLAS$.scal(BLAS.scala:223)
at org.apache.spark.ml.classification.LogisticAggregator.gradient(LogisticRegression.scala:1069)







java apache-spark apache-spark-sql apache-spark-mllib






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 20:41







Sian Yuan

















asked Mar 26 at 23:40









Sian YuanSian Yuan

11 bronze badge




11 bronze badge















  • You might need to define f2j dependency as well as netlib is declared pom-only

    – ollik1
    Mar 27 at 6:25

















  • You might need to define f2j dependency as well as netlib is declared pom-only

    – ollik1
    Mar 27 at 6:25
















You might need to define f2j dependency as well as netlib is declared pom-only

– ollik1
Mar 27 at 6:25





You might need to define f2j dependency as well as netlib is declared pom-only

– ollik1
Mar 27 at 6:25












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367722%2fapache-spark-in-java-machine-learning-com-github-fommil-netlib-f2jblas-dscalf%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55367722%2fapache-spark-in-java-machine-learning-com-github-fommil-netlib-f2jblas-dscalf%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현