Source: mllib/clustering/PowerIterationClusteringModel.js

  1. /*
  2. * Copyright 2016 IBM Corp.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. module.exports = function(kernelP) {
  17. return (function() {
  18. var Utils = require('../../utils.js');
  19. var RDD = require('../../rdd/RDD.js');
  20. var gKernelP = kernelP;
  21. /**
  22. * Model produced by {@link PowerIterationClustering}.
  23. *
  24. * @memberof module:eclairjs/mllib/clustering
  25. * @classdesc
  26. * @param {number} k number of clusters
  27. * @param {module:eclairjs/rdd.RDD} assignments an RDD of clustering [[PowerIterationClustering#Assignment]]s
  28. * @class
  29. */
  30. function PowerIterationClusteringModel() {
  31. Utils.handleConstructor(this, arguments, gKernelP);
  32. }
  33. /**
  34. * @returns {module:eclairjs/rdd.RDD}
  35. */
  36. PowerIterationClusteringModel.prototype.assignments = function() {
  37. var args = {
  38. target: this,
  39. method: 'assignments',
  40. returnType: RDD
  41. };
  42. return Utils.generate(args);
  43. };
  44. /**
  45. * @param {module:eclairjs.SparkContext} sc
  46. * @param {string} path
  47. * @returns {Promise.<Void>} A Promise that resolves to nothing.
  48. */
  49. PowerIterationClusteringModel.prototype.save = function(sc,path) {
  50. throw "not implemented by ElairJS";
  51. };
  52. PowerIterationClusteringModel.moduleLocation = '/mllib/clustering#PowerIterationClusteringModel';
  53. return PowerIterationClusteringModel;
  54. })();
  55. };