Class AlternatingLeastSquare.CalculateNextMatrix

  • All Implemented Interfaces:
    Serializable, org.apache.beam.sdk.transforms.display.HasDisplayData
    Enclosing class:
    AlternatingLeastSquare

    public static final class AlternatingLeastSquare.CalculateNextMatrix
    extends org.apache.beam.sdk.transforms.DoFn<org.apache.beam.sdk.values.KV<Integer,​org.apache.beam.sdk.values.KV<int[],​float[]>>,​org.apache.beam.sdk.values.KV<Integer,​float[]>>
    DoFn for calculating next matrix at each iteration.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.beam.sdk.transforms.DoFn

        org.apache.beam.sdk.transforms.DoFn.BoundedPerElement, org.apache.beam.sdk.transforms.DoFn.BundleFinalizer, org.apache.beam.sdk.transforms.DoFn.Element, org.apache.beam.sdk.transforms.DoFn.FieldAccess, org.apache.beam.sdk.transforms.DoFn.FinishBundle, org.apache.beam.sdk.transforms.DoFn.FinishBundleContext, org.apache.beam.sdk.transforms.DoFn.GetInitialRestriction, org.apache.beam.sdk.transforms.DoFn.GetRestrictionCoder, org.apache.beam.sdk.transforms.DoFn.GetSize, org.apache.beam.sdk.transforms.DoFn.MultiOutputReceiver, org.apache.beam.sdk.transforms.DoFn.NewTracker, org.apache.beam.sdk.transforms.DoFn.OnTimer, org.apache.beam.sdk.transforms.DoFn.OnTimerContext, org.apache.beam.sdk.transforms.DoFn.OnWindowExpiration, org.apache.beam.sdk.transforms.DoFn.OutputReceiver<T extends Object>, org.apache.beam.sdk.transforms.DoFn.ProcessContext, org.apache.beam.sdk.transforms.DoFn.ProcessContinuation, org.apache.beam.sdk.transforms.DoFn.ProcessElement, org.apache.beam.sdk.transforms.DoFn.RequiresStableInput, org.apache.beam.sdk.transforms.DoFn.Setup, org.apache.beam.sdk.transforms.DoFn.SideInput, org.apache.beam.sdk.transforms.DoFn.SplitRestriction, org.apache.beam.sdk.transforms.DoFn.StartBundle, org.apache.beam.sdk.transforms.DoFn.StartBundleContext, org.apache.beam.sdk.transforms.DoFn.StateId, org.apache.beam.sdk.transforms.DoFn.Teardown, org.apache.beam.sdk.transforms.DoFn.TimerId, org.apache.beam.sdk.transforms.DoFn.Timestamp, org.apache.beam.sdk.transforms.DoFn.UnboundedPerElement, org.apache.beam.sdk.transforms.DoFn.WindowedContext
    • Constructor Summary

      Constructors 
      Constructor Description
      CalculateNextMatrix​(int numFeatures, double lambda, org.apache.beam.sdk.values.PCollectionView<Map<Integer,​float[]>> fixedMatrixView)
      Constructor for CalculateNextMatrix DoFn class.
    • Constructor Detail

      • CalculateNextMatrix

        public CalculateNextMatrix​(int numFeatures,
                                   double lambda,
                                   org.apache.beam.sdk.values.PCollectionView<Map<Integer,​float[]>> fixedMatrixView)
        Constructor for CalculateNextMatrix DoFn class.
        Parameters:
        numFeatures - number of features.
        lambda - lambda.
        fixedMatrixView - a PCollectionView of the fixed matrix (item / user matrix).
    • Method Detail

      • processElement

        @ProcessElement
        public void processElement​(org.apache.beam.sdk.transforms.DoFn.ProcessContext c)
                            throws Exception
        ProcessElement method for BEAM.
        Parameters:
        c - ProcessContext.
        Throws:
        Exception - Exception on the way.