![JAR search and dependency download from the Maven repository](/logo.png)
com.github.chen0040.sparkml.recommender.X Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spark-ml-recommender Show documentation
Show all versions of spark-ml-recommender Show documentation
Recommender algorithms implemented in Java and for Spark
package com.github.chen0040.sparkml.recommender;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* Created by xschen on 5/6/2017.
*/
@Getter
@Setter
public class X implements Serializable {
private static final long serialVersionUID = -2453992460883398551L;
private List values = new ArrayList<>();
private String rowName;
public double dotProduct(Theta theta) {
double h = 0;
for(int k=0; k < values.size(); ++k){
h += theta.getValues().get(k) * values.get(k);
}
return h;
}
public double get(int index){
return values.get(index);
}
public int size() {
return values.size();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy