hibayesian / spark-fm Goto Github PK
View Code? Open in Web Editor NEWA parallel implementation of factorization machines based on Spark
License: Apache License 2.0
A parallel implementation of factorization machines based on Spark
License: Apache License 2.0
Q1. compare with the https://github.com/Intel-bigdata/imllib-spark,the auc performance of this spark-fm is very bad in my ctr prediction task, i have try mini-batch SGD、L-BFGS、parallel SGD and parallel FTRL, all auc < 0.7,but the same dataset and parameters on imllib-spark is 0.88,is there some fault in the implementation?
Q2. in my opinion, optimizer FTRL is not a good method in FM optimize task,because ftrl will lead to the matrix V is sparse,which will recduce the effect of cross features.
Bug1
in FactorizationMachinesUpdater, need to use the below code, otherwise, SGD will exist with only 1 iteration.
val weightsNew = weightsOld.copy.toArray
Bug2
in FactorizationMachinesGradient, change the code below, for the loss calculation.
// case Algo.BinaryClassification => -Math.log(1 + 1 / (1 + Math.exp(-p * label)))
case Algo.BinaryClassification => Math.log(1 + Math.exp(-p * label))
@hibayesian
I find FMClassifier in spark3, but I don't know what formate my featuresCol should be. I used my gbdt feature, but the result AUC is bad.
some of my code:
val classifier = new FMClassifier()
.setLabelCol("click")
.setFeaturesCol("gbdtFeature")
.setPredictionCol("predictClick")
.setProbabilityCol("probabilitys")
http://spark.apache.org/docs/latest/api/scala/org/apache/spark/ml/classification/FMClassifier.html
thank in advance!
Hi ,hibayesian !Thanks a lot for spark-fm sharing.I have checked the sample code which uses model=train.fit(trainData) and model.transform(testData) for prediction.
My concern is that how can I save the trained model in local txt and load it in future use.
I only found the related weight of the model but the weight can not be reloaded directly as model.
Looking forward to your concern and feedback.Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.