"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/main/java/com/rapidminer/operator/features/weighting/PCAWeighting.java" between
rapidminer-studio-9.4.1-src.tar.gz and rapidminer-studio-9.5.0-src.tar.gz

About: RapidMiner Studio is a code-free environment for designing advanced analytic processes with machine learning, data mining, text mining, predictive analytics and business analytics. Java source.

PCAWeighting.java  (rapidminer-studio-9.4.1-src):PCAWeighting.java  (rapidminer-studio-9.5.0-src)
skipping to change at line 23 skipping to change at line 23
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURP OSE. See the GNU * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURP OSE. See the GNU
* Affero General Public License for more details. * Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License alon g with this program. * You should have received a copy of the GNU Affero General Public License alon g with this program.
* If not, see http://www.gnu.org/licenses/. * If not, see http://www.gnu.org/licenses/.
*/ */
package com.rapidminer.operator.features.weighting; package com.rapidminer.operator.features.weighting;
import java.util.List; import java.util.List;
import org.apache.commons.lang.ArrayUtils;
import com.rapidminer.example.AttributeWeights; import com.rapidminer.example.AttributeWeights;
import com.rapidminer.example.ExampleSet; import com.rapidminer.example.ExampleSet;
import com.rapidminer.operator.Model; import com.rapidminer.operator.Model;
import com.rapidminer.operator.OperatorCapability; import com.rapidminer.operator.OperatorCapability;
import com.rapidminer.operator.OperatorCreationException; import com.rapidminer.operator.OperatorCreationException;
import com.rapidminer.operator.OperatorDescription; import com.rapidminer.operator.OperatorDescription;
import com.rapidminer.operator.OperatorException; import com.rapidminer.operator.OperatorException;
import com.rapidminer.operator.OperatorVersion;
import com.rapidminer.operator.UserError; import com.rapidminer.operator.UserError;
import com.rapidminer.operator.features.transformation.PCA; import com.rapidminer.operator.features.transformation.PCA;
import com.rapidminer.parameter.ParameterType; import com.rapidminer.parameter.ParameterType;
import com.rapidminer.parameter.ParameterTypeInt; import com.rapidminer.parameter.ParameterTypeInt;
import com.rapidminer.tools.OperatorService; import com.rapidminer.tools.OperatorService;
/** /**
* Uses the factors of one of the principal components (default is the first) as feature weights. * Uses the factors of one of the principal components (default is the first) as feature weights.
* Please note that the PCA weighting operator is currently the only one which a lso works on data * Please note that the PCA weighting operator is currently the only one which a lso works on data
* sets without a label, i.e. for unsupervised learning. * sets without a label, i.e. for unsupervised learning.
skipping to change at line 58 skipping to change at line 61
} }
@Override @Override
protected AttributeWeights calculateWeights(ExampleSet exampleSet) throws OperatorException { protected AttributeWeights calculateWeights(ExampleSet exampleSet) throws OperatorException {
PCA pcaOperator = null; PCA pcaOperator = null;
try { try {
pcaOperator = OperatorService.createOperator(PCA.class); pcaOperator = OperatorService.createOperator(PCA.class);
} catch (OperatorCreationException e) { } catch (OperatorCreationException e) {
throw new UserError(this, 904, "inner pca operator", e.ge tMessage()); throw new UserError(this, 904, "inner pca operator", e.ge tMessage());
} }
pcaOperator.setCompatibilityLevel(this.getCompatibilityLevel());
pcaOperator.setParameter(PCA.PARAMETER_REDUCTION_TYPE, PCA.REDUCT ION_NONE + ""); pcaOperator.setParameter(PCA.PARAMETER_REDUCTION_TYPE, PCA.REDUCT ION_NONE + "");
ComponentWeights weightOperator = null; ComponentWeights weightOperator = null;
try { try {
weightOperator = OperatorService.createOperator(Component Weights.class); weightOperator = OperatorService.createOperator(Component Weights.class);
} catch (OperatorCreationException e) { } catch (OperatorCreationException e) {
throw new UserError(this, 904, "inner weight operator", e .getMessage()); throw new UserError(this, 904, "inner weight operator", e .getMessage());
} }
weightOperator.setParameter(ComponentWeights.PARAMETER_COMPONENT_ NUMBER, weightOperator.setParameter(ComponentWeights.PARAMETER_COMPONENT_ NUMBER,
getParameterAsInt(ComponentWeights.PARAMETER_COMP ONENT_NUMBER) + ""); getParameterAsInt(ComponentWeights.PARAMETER_COMP ONENT_NUMBER) + "");
skipping to change at line 97 skipping to change at line 101
@Override @Override
public boolean supportsCapability(OperatorCapability capability) { public boolean supportsCapability(OperatorCapability capability) {
switch (capability) { switch (capability) {
case NUMERICAL_ATTRIBUTES: case NUMERICAL_ATTRIBUTES:
case NO_LABEL: case NO_LABEL:
return true; return true;
default: default:
return false; return false;
} }
} }
@Override
public OperatorVersion[] getIncompatibleVersionChanges() {
return (OperatorVersion[]) ArrayUtils.add(super.getIncompatibleVe
rsionChanges(), PCA.EIGENVALUE_ALGORITHM_CHANGED);
}
} }
 End of changes. 4 change blocks. 
0 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)