Skip to content

Commit

Permalink
Release RapidMiner 7.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Wilms-Pfau committed May 10, 2017
1 parent 8abf59f commit ca3a8df
Show file tree
Hide file tree
Showing 24 changed files with 639 additions and 159 deletions.
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ dependencies {

// RapidMiner license framework for license management
compile 'com.rapidminer.license:rapidminer-license-api:3.2.0'
compile 'com.rapidminer.license:rapidminer-license-commons:3.2.1'
compile('com.rapidminer.license:rapidminer-license-commons:3.2.1'){
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
}

// RapidMiner API
compile 'com.rapidminer:rapidminer-api:0.2.1'
Expand All @@ -33,7 +36,7 @@ dependencies {
compile 'com.rapidminer.external:alphanumeric-sorting:1.0.1'

// VLDocking as docking framework (https://code.google.com/p/vldocking/)
compile 'com.rapidminer.external:vldocking:1.2.0'
compile 'com.rapidminer.external:vldocking:1.2.1'

// Freehep for vector graphic export (http://java.freehep.org/)
compile('org.freehep:freehep-graphicsio-ps:2.3') {
Expand Down Expand Up @@ -137,8 +140,8 @@ dependencies {
compile 'com.h2database:h2:1.4.194'

// up until 7.4.1 this was a transitive dependency coming from license-commons (jackson version 2.4.0)
compile 'com.fasterxml.jackson.core:jackson-core:2.8.8'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.8'
compile 'com.fasterxml.jackson.core:jackson-core:2.6.6'
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.6'
}

task wrapper(type: Wrapper) { gradleVersion = '2.14.1' }
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=7.5.0
version=7.5.1
group=com.rapidminer.studio
14 changes: 7 additions & 7 deletions src/main/java/com/rapidminer/MacroHandler.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* Copyright (C) 2001-2017 by RapidMiner and the contributors
*
*
* Complete list of developers available at our web site:
*
*
* http://rapidminer.com
*
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see http://www.gnu.org/licenses/.
*/
*/
package com.rapidminer;

import java.text.DateFormat;
Expand Down Expand Up @@ -100,7 +100,7 @@ public class MacroHandler extends Observable {
/**
* Used for formatting the %{process_start} and current time %{t} macro
*/
private static final ThreadLocal<DateFormat> DATE_FORMAT = new ThreadLocal<DateFormat>() {
public static final ThreadLocal<DateFormat> DATE_FORMAT = new ThreadLocal<DateFormat>() {

@Override
protected DateFormat initialValue() {
Expand Down
41 changes: 23 additions & 18 deletions src/main/java/com/rapidminer/Process.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* Copyright (C) 2001-2017 by RapidMiner and the contributors
*
*
* Complete list of developers available at our web site:
*
*
* http://rapidminer.com
*
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see http://www.gnu.org/licenses/.
*/
*/
package com.rapidminer;

import java.io.File;
Expand All @@ -32,6 +32,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -922,6 +923,11 @@ private final void prepareRun(final int logVerbosity) throws OperatorException {
AttributeFactory.resetNameCounters();

getLogger().fine("Process initialised.");

// add process start macro value here already to have it available for root parameters
// can be overwritten if it is passed to the run() method via the macro map
getMacroHandler().addMacro(MacroHandler.PROCESS_START,
MacroHandler.DATE_FORMAT.get().format(new Date(System.currentTimeMillis())));
}

/**
Expand Down Expand Up @@ -1224,7 +1230,17 @@ public final IOContainer run(final IOContainer input, int logVerbosity, final Ma
logVerbosity = LogService.OFF;
}
logVerbosity = Math.min(logVerbosity, myVerbosity);
getLogger().setLevel(WrapperLoggingHandler.LEVELS[logVerbosity]);

prepareRun(logVerbosity);

// apply macros
applyContextMacros();
if (macroMap != null) {
for (Map.Entry<String, String> entry : macroMap.entrySet()) {
getMacroHandler().addMacro(entry.getKey(), entry.getValue());
}
}

String logFilename = rootOperator.getParameter(ProcessRootOperator.PARAMETER_LOGFILE);
Handler logHandler = null;
if (logFilename != null) {
Expand All @@ -1241,9 +1257,6 @@ public final IOContainer run(final IOContainer input, int logVerbosity, final Ma
getLogger().addHandler(logHandler);
}

setProcessState(PROCESS_STATE_RUNNING);
prepareRun(logVerbosity);

long start = System.currentTimeMillis();

rootOperator.processStarts();
Expand Down Expand Up @@ -1287,14 +1300,6 @@ public void run() {
}
}

// macros
applyContextMacros();
if (macroMap != null) {
for (Map.Entry<String, String> entry : macroMap.entrySet()) {
getMacroHandler().addMacro(entry.getKey(), entry.getValue());
}
}

if (name != null) {
getLogger().info("Process " + name + " starts");
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* Copyright (C) 2001-2017 by RapidMiner and the contributors
*
*
* Complete list of developers available at our web site:
*
*
* http://rapidminer.com
*
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see http://www.gnu.org/licenses/.
*/
*/
package com.rapidminer.example.set;

import java.util.Iterator;
Expand Down Expand Up @@ -43,17 +43,53 @@ public class AttributeSelectionExampleSet extends AbstractExampleSet {
* Constructs a new AttributeSelectionExampleSet. Only those attributes with a true value in the
* selection mask will be used. If the given mask is null, all regular attributes of the parent
* example set will be used.
*
* @deprecated use static creation method {@link #create(ExampleSet, boolean[])} instead
*/
@Deprecated
public AttributeSelectionExampleSet(ExampleSet exampleSet, boolean[] selectionMask) {
this.parent = (ExampleSet) exampleSet.clone();
selectAttributes(selectionMask, parent);
}

/**
* Creates a new example set with only the regular attributes selected by the selection mask.
* Only those attributes with a true value in the selection mask will be used. If the given mask
* is null, all regular attributes of the parent example set will be used. The special
* attributes stay the same.
*
* @param exampleSet
* the example set to start from
* @param selectionMask
* the mask defining which attributes to use
* @return an example set which the specified attributes selected
* @throws IllegalArgumentException
* if the selectionMask has not the same number of entries as regular attributes in
* the example set
* @since 7.5.1
*/
public static ExampleSet create(ExampleSet exampleSet, boolean[] selectionMask) {
ExampleSet newSet = (ExampleSet) exampleSet.clone();
selectAttributes(selectionMask, newSet);
return newSet;
}

/**
* Removes all attributes at which index the selectinMask is {@code false}.
*
* @throws IllegalArgumentException
* if the selectionMask has not the same number of entries as regular attributes in
* the example set
*/
private static void selectAttributes(boolean[] selectionMask, ExampleSet exampleSet) {
if (selectionMask != null) {
if (selectionMask.length != exampleSet.getAttributes().size()) {
throw new IllegalArgumentException(
"Length of the selection mask must be equal to the parent's number of attributes.");
}

int counter = 0;
Iterator<Attribute> i = this.parent.getAttributes().iterator();
Iterator<Attribute> i = exampleSet.getAttributes().iterator();
while (i.hasNext()) {
i.next();
if (!selectionMask[counter]) {
Expand Down
52 changes: 39 additions & 13 deletions src/main/java/com/rapidminer/example/set/ModelViewExampleSet.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* Copyright (C) 2001-2017 by RapidMiner and the contributors
*
*
* Complete list of developers available at our web site:
*
*
* http://rapidminer.com
*
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Affero General Public License for more details.
*
*
* You should have received a copy of the GNU Affero General Public License along with this program.
* If not, see http://www.gnu.org/licenses/.
*/
*/
package com.rapidminer.example.set;

import java.io.IOException;
Expand Down Expand Up @@ -46,15 +46,41 @@ public class ModelViewExampleSet extends AbstractExampleSet {

private Attributes attributes;

/**
* @deprecated use static creation method {@link #create(ExampleSet, ViewModel)} instead
*/
@Deprecated
public ModelViewExampleSet(ExampleSet parent, ViewModel model) {
this.parent = (ExampleSet) parent.clone();
Attributes modelAttributes = model.getTargetAttributes(parent);
// clear parent attributes and copy model attributes there
Attributes parentAttributes = this.parent.getAttributes();
parentAttributes.clearRegular();
parentAttributes.clearSpecial();
for (Iterator<AttributeRole> i = modelAttributes.allAttributeRoles(); i.hasNext();) {
parentAttributes.add(i.next());
replaceAttributes(this.parent, model.getTargetAttributes(parent));
}

/**
* Creates a new example set based on parent that has the attributes specified by the model.
*
* @param parent
* the example set from which to create the new one
* @param model
* the model supplying the new attributes
* @return an example set with attributes provided by the model
* @since 7.5.1
*/
public static ExampleSet create(ExampleSet parent, ViewModel model) {
ExampleSet newSet = (ExampleSet) parent.clone();
replaceAttributes(newSet, model.getTargetAttributes(parent));
return newSet;
}

/**
* Replaces the attributes of exampleSet by the given replacementAttributes.
*/
private static void replaceAttributes(ExampleSet exampleSet, Attributes replacementAttributes) {
Attributes attributes = exampleSet.getAttributes();
// clear attributes and copy replacement attributes there
attributes.clearRegular();
attributes.clearSpecial();
for (Iterator<AttributeRole> i = replacementAttributes.allAttributeRoles(); i.hasNext();) {
attributes.add(i.next());
}
}

Expand Down

0 comments on commit ca3a8df

Please sign in to comment.