Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: a67102ee65
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (41 sloc) 1.679 kB
@comment{
Copyright 2011 JBoss Inc
Licensed 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.
}
@comment{
Assigns a value to the derived field if the original value falls within one of the given intervals
/**
* @param name - derived field name
* @param origField - the field to alias
* @param intv - the Interval (pmml)
* @param index - the bin index
* @param target - the value associated to the bin
*/
}
@declare{'intervalBinningRule'}
rule "bin_@{name}_@{index}"
@if{ isInnerFieldName( name ) } @@activationListener('direct') @end{}
when
$in : @{origField}( valid == true, missing == false,
value @if{intv.closure.startsWith("closed")}>=@else{}>@end{} @{intv.leftMargin} && value @if{intv.closure.endsWith("Closed")}<=@else{}<@end{} @{intv.rightMargin},
$ctx : context @if{ context != null } , context == @{format("string",context)} @end{}
)
then
@{name} x = new @{name}();
x.setValue(@{target});
x.setMissing(false);
x.setValid(true);
x.setName(@{format("string",name)});
x.setContext($ctx);
insertLogical(x);
end
@end{}
@includeNamed{'intervalBinningRule'}
Jump to Line
Something went wrong with that request. Please try again.