walterddr commented on a change in pull request #9082: [FLINK-13207][ml] Add 
the algorithm of Fast Fourier Transformation(FFT)
URL: https://github.com/apache/flink/pull/9082#discussion_r340712968
 
 

 ##########
 File path: 
flink-ml-parent/flink-ml-lib/src/main/java/org/apache/flink/ml/common/utils/FFT.java
 ##########
 @@ -0,0 +1,210 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.flink.ml.common.utils;
+
+import org.apache.commons.math3.complex.Complex;
+
+/**
+ * Fast Fourier Transformation(FFT).
+ * Provides 2 algorithms:
+ * 1. Cooley-Tukey algorithm, high performance, but only supports length of 
power-of-2.
+ * 2. Chirp-Z algorithm, can perform FFT with any length.
+ */
+public class FFT {
 
 Review comment:
   I am fine with the `FFT` class currently living in the `common/utils` 
package. however, we probably need to consider moving these to more suitable 
location. since these are heavy-weighted classes with dedicated purpose. 
   I think maybe the reason that raised the question @ex00 have - since it does 
not immediately clear why a "transform" class sits in a common utility package. 
   
   Some thoughts I have based on some digging: splitting based on functionality 
group might be better? E.g.
   1. in feature extraction: embedding, hashing, PCA, etc: Both Spark & 
Sckit-Learn put them in dedicated package "feature extraction"
   2. in algorithms/optimizers: E.g. GaussianMixture, DistanceMeasure: are put 
in "clustering" package;
   #REF: 
[1](https://github.com/apache/spark/tree/master/mllib/src/main/scala/org/apache/spark/ml/feature),
 
[2](https://github.com/scikit-learn/scikit-learn/tree/master/sklearn/feature_extraction)
 
   
   So IMO it makes sense to put them in a package name `feature.extraction` or 
`feature`. Any idea you have in mind @xuyang1706 @ex00 @qiuxiafei ?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

Reply via email to