avplatonov commented on a change in pull request #6001: IGNITE-11137:
IgniteModelStorage improvements for IgniteModel and SQL functionality
URL: https://github.com/apache/ignite/pull/6001#discussion_r253058533
##########
File path: modules/ml/src/main/java/org/apache/ignite/ml/sql/SQLFunctions.java
##########
@@ -39,10 +70,15 @@
*/
@QuerySqlFunction
public static double predict(String mdl, Double... x) {
- System.out.println("Prediction for " + Arrays.toString(x));
+ Model<Vector, Double> infMdl;
- try (Model<Vector, Double> infMdl =
IgniteModelStorageUtil.getModel(mdl)) {
- return infMdl.predict(VectorUtils.of(x));
+ synchronized (cache) {
Review comment:
may be we can use double-check?
synchronization on every predict can be expensive I think
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services