Permalink
Browse files

Merge pull request #12 from vinodkiran/master

PR for deleting drools-scorecards under drools-chance
  • Loading branch information...
2 parents 1b5ee3b + 8fee39c commit 48c413fa608de9651f4bb9fa37b68bd1680084b0 @manstis manstis committed Oct 22, 2012
Showing with 0 additions and 6,997 deletions.
  1. +0 −143 drools-scorecards/pom.xml
  2. +0 −36 drools-scorecards/src/main/java/org/drools/scorecards/BaselineScore.java
  3. +0 −118 drools-scorecards/src/main/java/org/drools/scorecards/DroolsScorecard.java
  4. +0 −50 drools-scorecards/src/main/java/org/drools/scorecards/InitialScore.java
  5. +0 −48 drools-scorecards/src/main/java/org/drools/scorecards/PartialScore.java
  6. +0 −163 drools-scorecards/src/main/java/org/drools/scorecards/ScorecardCompiler.java
  7. +0 −33 drools-scorecards/src/main/java/org/drools/scorecards/ScorecardError.java
  8. +0 −21 drools-scorecards/src/main/java/org/drools/scorecards/ScorecardFormat.java
  9. +0 −101 drools-scorecards/src/main/java/org/drools/scorecards/StringUtil.java
  10. +0 −380 drools-scorecards/src/main/java/org/drools/scorecards/drl/AbstractDRLEmitter.java
  11. +0 −116 drools-scorecards/src/main/java/org/drools/scorecards/drl/DeclaredTypesDRLEmitter.java
  12. +0 −134 drools-scorecards/src/main/java/org/drools/scorecards/drl/ExternalModelDRLEmitter.java
  13. +0 −30 drools-scorecards/src/main/java/org/drools/scorecards/parser/AbstractScorecardParser.java
  14. +0 −35 drools-scorecards/src/main/java/org/drools/scorecards/parser/ScorecardParseException.java
  15. +0 −141 drools-scorecards/src/main/java/org/drools/scorecards/parser/xls/ExcelScorecardValidator.java
  16. +0 −64 drools-scorecards/src/main/java/org/drools/scorecards/parser/xls/MergedCellRange.java
  17. +0 −352 drools-scorecards/src/main/java/org/drools/scorecards/parser/xls/XLSEventDataCollector.java
  18. +0 −45 drools-scorecards/src/main/java/org/drools/scorecards/parser/xls/XLSKeywords.java
  19. +0 −128 drools-scorecards/src/main/java/org/drools/scorecards/parser/xls/XLSScorecardParser.java
  20. +0 −32 drools-scorecards/src/main/java/org/drools/scorecards/pmml/PMMLExtensionNames.java
  21. +0 −367 drools-scorecards/src/main/java/org/drools/scorecards/pmml/PMMLGenerator.java
  22. +0 −29 drools-scorecards/src/main/java/org/drools/scorecards/pmml/PMMLOperators.java
  23. +0 −111 drools-scorecards/src/main/java/org/drools/scorecards/pmml/ScorecardPMMLUtils.java
  24. +0 −44 drools-scorecards/src/main/resources/org/dmg/pmml/bindings.xjb
  25. +0 −3,370 drools-scorecards/src/main/resources/org/dmg/pmml/pmml-4-1.xsd
  26. +0 −1 drools-scorecards/src/main/resources/org/dmg/pmml/run_xjc.bat
  27. +0 −106 drools-scorecards/src/test/java/org/drools/scorecards/DrlFromPMMLTest.java
  28. +0 −136 drools-scorecards/src/test/java/org/drools/scorecards/ExternalObjectModelTest.java
  29. +0 −268 drools-scorecards/src/test/java/org/drools/scorecards/PMMLDocumentTest.java
  30. +0 −65 drools-scorecards/src/test/java/org/drools/scorecards/ScorecardParseErrorsTest.java
  31. +0 −271 drools-scorecards/src/test/java/org/drools/scorecards/ScorecardReasonCodeTest.java
  32. +0 −59 drools-scorecards/src/test/java/org/drools/scorecards/example/Applicant.java
  33. BIN drools-scorecards/src/test/resources/scoremodel_c.xls
  34. BIN drools-scorecards/src/test/resources/scoremodel_errors.xls
  35. BIN drools-scorecards/src/test/resources/scoremodel_externalmodel.xls
  36. BIN drools-scorecards/src/test/resources/scoremodel_reasoncodes.xls
View
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ /*
- ~ * Copyright 2012 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.
- ~ */
- -->
-
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>drools-chance</artifactId>
- <groupId>org.drools</groupId>
- <version>5.5.0-SNAPSHOT</version>
- </parent>
-
- <groupId>org.drools</groupId>
- <artifactId>drools-scorecards</artifactId>
-
- <name>drools-scorecards</name>
- <description>Add support for PMML scorecards</description>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- <!-- Internal dependencies -->
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-compiler</artifactId>
- </dependency>
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-templates</artifactId>
- </dependency>
-
- <!-- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-decisiontables</artifactId>
- </dependency>-->
-
- <!-- External dependencies -->
- <dependency>
- <groupId>org.apache.poi</groupId>
- <artifactId>poi</artifactId>
- <version>3.8</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.xml</groupId>
- <artifactId>jaxb-xjc</artifactId>
- <version>2.0EA3</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- </dependency>
-
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.1.13</version>
- </dependency>
- </dependencies>
-
- <repositories>
- <repository>
- <id>Lab4Inf</id>
- <url>http://www.lab4inf.fh-muenster.de/lab4inf/maven-repository</url>
- </repository>
- </repositories>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <id>include-generated-sources</id>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/target/generated-sources</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jaxb2-maven-plugin</artifactId>
- <version>1.3</version>
- <executions>
- <execution>
- <goals>
- <goal>xjc</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <outputDirectory>${basedir}/target/generated-sources/java</outputDirectory>
- <packageName>org.dmg.pmml_4_1</packageName>
- <schemaDirectory>${basedir}/src/main/resources/org/dmg/pmml</schemaDirectory>
- <bindingDirectory>${basedir}/src/main/resources/org/dmg/pmml</bindingDirectory>
- <extension>true</extension>
- <clearOutputDir>false</clearOutputDir>
- <arguments>-no-header</arguments>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
@@ -1,36 +0,0 @@
-/*
- * Copyright 2012 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.
- */
-
-package org.drools.scorecards;
-
-import java.io.Serializable;
-
-public class BaselineScore extends InitialScore implements Serializable {
- protected String characteristic;
-
- public BaselineScore(String scorecardName, String characteristic, double score) {
- super(scorecardName, score);
- this.characteristic = characteristic;
- }
-
- public String getCharacteristic() {
- return characteristic;
- }
-
- public void setCharacteristic(String characteristic) {
- this.characteristic = characteristic;
- }
-}
@@ -1,118 +0,0 @@
-/*
- * Copyright 2012 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.
- */
-
-package org.drools.scorecards;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-public class DroolsScorecard implements Serializable {
- double calculatedScore;
- List<String> reasonCodes = new ArrayList<String>();
- Map<String, Double> baselineScoreMap = new HashMap<String, Double>();
- private int reasonCodeAlgorithm;
- public static int REASON_CODE_ALGORITHM_POINTSABOVE = 1;
- public static int REASON_CODE_ALGORITHM_POINTSBELOW = -1;
-
- public int getReasonCodeAlgorithm() {
- return reasonCodeAlgorithm;
- }
-
- public void setReasonCodeAlgorithm(int reasonCodeAlgorithm) {
- this.reasonCodeAlgorithm = reasonCodeAlgorithm;
- }
-
- public void setBaselineScore(String characteristic, int baselineScore){
- baselineScoreMap.put(characteristic, (double)baselineScore);
- }
-
- public void setBaselineScore(String characteristic, double baselineScore){
- baselineScoreMap.put(characteristic, baselineScore);
- }
-
- public double getCalculatedScore() {
- return calculatedScore;
- }
-
- public void setCalculatedScore(double calculatedScore) {
- this.calculatedScore = calculatedScore;
- }
-
- public void sortReasonCodes() {
-
- }
-
-// public void addPartialScore(int partialScore) {
-// this.calculatedScore += partialScore;
-// }
-//
-// public void setInitialScore(int initialScore) {
-// this.calculatedScore = initialScore;
-// }
-
- public void setInitialScore(double initialScore) {
- this.calculatedScore = initialScore;
- }
-
-// public void addPartialScore(double partialScore) {
-// this.calculatedScore += partialScore;
-// }
-//
-// public void addPartialScore(String field, double partialScore, String reasonCode) {
-// this.calculatedScore += partialScore;
-// reasonCodes.add(reasonCode);
-// }
-
-// public void addReasonCode(String reasonCode){
-// reasonCodes.add(reasonCode);
-// }
-//
- public List<String> getReasonCodes() {
- return Collections.unmodifiableList(reasonCodes);
- }
-
- public void setReasonCodes(List<String> reasonCodes) {
- this.reasonCodes = reasonCodes;
- }
-
- public void sortReasonCodes(List<PartialScore> partialScores) {
- TreeMap<Double, String> distanceMap = new TreeMap<Double, String>();
- for (PartialScore partialScore : partialScores ){
- if (baselineScoreMap.get(partialScore.getCharacteristic()) != null ) {
- double baseline = baselineScoreMap.get(partialScore.getCharacteristic());
- double distance = 0;
- if (getReasonCodeAlgorithm() == REASON_CODE_ALGORITHM_POINTSABOVE) {
- distance = (baseline - partialScore.getScore())+partialScore.getPosition();
- distanceMap.put(distance, partialScore.getReasoncode());
- } else if (getReasonCodeAlgorithm() == REASON_CODE_ALGORITHM_POINTSBELOW){
- distance = (partialScore.getScore()-baseline)+partialScore.getPosition();
- distanceMap.put(distance, partialScore.getReasoncode());
- }
- }
- }
-
- for ( Double distance : distanceMap.descendingKeySet()) {
- System.out.println(distance+" "+distanceMap.get(distance));
- }
- }
- public DroolsScorecard() {
- }
-}
@@ -1,50 +0,0 @@
-/*
- * Copyright 2012 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.
- */
-
-package org.drools.scorecards;
-
-import java.io.Serializable;
-
-public class InitialScore implements Serializable {
- protected String scorecardName;
- protected double score;
-
- public String getScorecardName() {
- return scorecardName;
- }
-
- public void setScorecardName(String scorecardName) {
- this.scorecardName = scorecardName;
- }
-
- public double getScore() {
- return score;
- }
-
- public void setScore(double score) {
- this.score = score;
- }
-
- public InitialScore(String scorecardName, double score) {
-
- this.scorecardName = scorecardName;
- this.score = score;
- }
-
- public InitialScore() {
-
- }
-}
@@ -1,48 +0,0 @@
-/*
- * Copyright 2012 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.
- */
-package org.drools.scorecards;
-
-import java.io.Serializable;
-
-public class PartialScore extends BaselineScore implements Serializable {
- protected String reasoncode;
- protected int position;
-
- public PartialScore(String scorecardName, String characteristic, double score, String reasoncode, int position) {
- super(scorecardName, characteristic, score);
- this.reasoncode = reasoncode;
- this.position = position;
- }
-
- public PartialScore(String scorecardName, String characteristic, double score) {
- super(scorecardName, characteristic, score);
- this.scorecardName = scorecardName;
- this.characteristic = characteristic;
- this.score = score;
- }
-
- public int getPosition() {
- return position;
- }
-
- public String getReasoncode() {
- return reasoncode;
- }
-
- public void setReasoncode(String reasoncode) {
- this.reasoncode = reasoncode;
- }
-}
Oops, something went wrong.

0 comments on commit 48c413f

Please sign in to comment.