You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2021/10/18 04:01:16 UTC

[GitHub] [fineract] xurror opened a new pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

xurror opened a new pull request #1811:
URL: https://github.com/apache/fineract/pull/1811


   ## Description
   
   Credit Scorecard Algorithms integrations with fineract backend
   
   https://issues.apache.org/jira/browse/FINCN-252
   
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] xurror edited a comment on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
xurror edited a comment on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-945379809


   The PR is good now. Please review when you can. @ptuomola @awasum 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan commented on a change in pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
BLasan commented on a change in pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#discussion_r748741941



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java
##########
@@ -662,7 +667,12 @@ public String loanSchema() {
                     + " lpvi.minimum_gap as minimuminstallmentgap, lpvi.maximum_gap as maximuminstallmentgap, "
                     + " lp.can_use_for_topup as canUseForTopup, " + " l.is_topup as isTopup, " + " topup.closure_loan_id as closureLoanId, "
                     + " l.total_recovered_derived as totalRecovered" + ", topuploan.account_no as closureLoanAccountNo, "
-                    + " topup.topup_amount as topupAmount " + " from m_loan l" //
+                    + " topup.topup_amount as topupAmount, "
+
+                    + " csc.id as scorecardId, csc.scorecard_scoring_method as scoringMethod, csc.scorecard_scoring_model as scoringModel "
+

Review comment:
       Unnecessary lines




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] github-actions[bot] closed pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #1811:
URL: https://github.com/apache/fineract/pull/1811


   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] awasum commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
awasum commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-1084342219


   > Closing because it looks abandoned.
   
   I see a commit was made by author 25 days ago.. 
   Please @xurror please can you find time to make the build pass and the merge conflicts all fixed if any... It takes  30 days for the bug to be ato closed by the bot.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan commented on a change in pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
BLasan commented on a change in pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#discussion_r748741255



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/creditscorecard/domain/MLScorecard.java
##########
@@ -0,0 +1,136 @@
+/**
+ * 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.fineract.portfolio.creditscorecard.domain;
+
+import java.math.BigDecimal;
+import java.util.Objects;
+import javax.persistence.Column;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
+
+@Entity
+@Table(name = "m_ml_scorecard")
+public class MLScorecard extends AbstractPersistableCustom {
+
+    @Embedded
+    private MLScorecardFields scorecardFields;
+
+    @Column(name = "predicted_risk")
+    private String predictedRisk;
+
+    @Column(name = "accuracy")
+    private BigDecimal accuracy;
+
+    @Column(name = "actual_risk")
+    private String actualRisk;
+
+    @Column(name = "prediction_request_id")
+    private Integer predictionRequestId;
+
+    public MLScorecard() {

Review comment:
       Do we need this constructor?




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] github-actions[bot] commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-1037599918


   This pull request seems to be stale.  Are you still planning to work on it?  We will automatically close it in 30 days.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] ptuomola commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
ptuomola commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-939197052


   Looks interesting! Can you fix the merge conflicts and squash the commits please, and I'll take a look...


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan commented on a change in pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
BLasan commented on a change in pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#discussion_r748740601



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/creditscorecard/domain/CreditScorecard.java
##########
@@ -0,0 +1,115 @@
+/**
+ * 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.fineract.portfolio.creditscorecard.domain;
+
+import java.util.Objects;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
+
+@Entity
+@Table(name = "m_credit_scorecard")
+public class CreditScorecard extends AbstractPersistableCustom {
+
+    @Column(name = "scorecard_scoring_method")
+    private String scoringMethod;
+
+    @Column(name = "scorecard_scoring_model")
+    private String scoringModel;
+
+    @OneToOne(cascade = CascadeType.ALL)
+    @JoinColumn(name = "rule_based_scorecard_id", referencedColumnName = "id")
+    private org.apache.fineract.portfolio.creditscorecard.domain.RuleBasedScorecard ruleBasedScorecard;
+
+    @OneToOne(cascade = CascadeType.ALL)
+    @JoinColumn(name = "stat_scorecard_id", referencedColumnName = "id")
+    private StatScorecard statScorecard;
+
+    @OneToOne(cascade = CascadeType.ALL)
+    @JoinColumn(name = "ml_scorecard_id", referencedColumnName = "id")
+    private org.apache.fineract.portfolio.creditscorecard.domain.MLScorecard mlScorecard;
+
+    public CreditScorecard() {
+        //
+    }
+
+    public CreditScorecard(String scoringMethod, String scoringModel) {
+        this.scoringMethod = scoringMethod;
+        this.scoringModel = scoringModel;
+    }
+
+    public CreditScorecard(String scoringMethod, String scoringModel,
+            org.apache.fineract.portfolio.creditscorecard.domain.RuleBasedScorecard ruleBasedScorecard, StatScorecard statScorecard,
+            org.apache.fineract.portfolio.creditscorecard.domain.MLScorecard mlScorecard) {
+        this.scoringMethod = scoringMethod;
+        this.scoringModel = scoringModel;
+        this.ruleBasedScorecard = ruleBasedScorecard;
+        this.statScorecard = statScorecard;
+        this.mlScorecard = mlScorecard;
+    }
+
+    public String getScoringMethod() {
+        return scoringMethod;
+    }
+
+    public String getScoringModel() {
+        return scoringModel;
+    }
+
+    public org.apache.fineract.portfolio.creditscorecard.domain.RuleBasedScorecard getRuleBasedScorecard() {

Review comment:
       Can't we import this and directly use `RuleBasedScorecard`?




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] awasum commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
awasum commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-894549889


   Thanks very much for this work. Why is the issue on the Fineract CN issue tracker and not on the Fineract 1.x issue tracker? cc @edcable 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] xurror closed pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
xurror closed pull request #1811:
URL: https://github.com/apache/fineract/pull/1811


   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] xurror edited a comment on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
xurror edited a comment on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-899239552


   I think there was the idea of making it a microservice, that's why we have a seperate repository where the module server is hosted so it can be run independently.
   Some changes feature here because the first level of integration of the project was focused on it's usability with Fineract 1.x.
   
   Referencing Here the UI level changes(https://github.com/openMF/web-app/pull/1353) and Scorecard Server(https://github.com/apache/fineract-credit-scorecard)


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] awasum commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
awasum commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-1011711478


   @xurror , please fix review comments if possible, fix conflicts so this can be reviewed.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] awasum commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
awasum commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-944306287


   @xurror Please fix merge conflicts 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan commented on a change in pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
BLasan commented on a change in pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#discussion_r748741954



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java
##########
@@ -681,7 +691,9 @@ public String loanSchema() {
                     + " left join ref_loan_transaction_processing_strategy lps on lps.id = l.loan_transaction_strategy_id"
                     + " left join m_product_loan_variable_installment_config lpvi on lpvi.loan_product_id = l.product_id"
                     + " left join m_loan_topup as topup on l.id = topup.loan_id"
-                    + " left join m_loan as topuploan on topuploan.id = topup.closure_loan_id";
+                    + " left join m_loan as topuploan on topuploan.id = topup.closure_loan_id"
+

Review comment:
       Here too




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] github-actions[bot] commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-932641707


   This pull request seems to be stale.  Are you still planning to work on it?  We will automatically close it in 30 days.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vidakovic closed pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
vidakovic closed pull request #1811:
URL: https://github.com/apache/fineract/pull/1811


   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] github-actions[bot] commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-993024990


   This pull request seems to be stale.  Are you still planning to work on it?  We will automatically close it in 30 days.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] xurror commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
xurror commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-899239665


   I've finally added the necessary IT tests for this module.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan commented on a change in pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
BLasan commented on a change in pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#discussion_r748740660



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/creditscorecard/domain/CreditScorecardFeature.java
##########
@@ -0,0 +1,166 @@
+/**
+ * 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.fineract.portfolio.creditscorecard.domain;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import org.apache.fineract.infrastructure.core.api.JsonCommand;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
+import org.apache.fineract.portfolio.creditscorecard.data.CreditScorecardFeatureData;
+import org.apache.fineract.portfolio.creditscorecard.service.CreditScorecardEnumerations;
+
+@Entity
+@Table(name = "m_credit_scorecard_feature")
+public class CreditScorecardFeature extends AbstractPersistableCustom implements Serializable {
+
+    @Column(name = "name", length = 100, unique = true, nullable = false)
+    private String name;
+
+    @Column(name = "value_type_enum", nullable = false)
+    private Integer valueType;
+
+    @Column(name = "data_type_enum", nullable = false)
+    private Integer dataType;
+
+    @Column(name = "category_enum", nullable = false)
+    private Integer category;
+
+    @Column(name = "is_active", nullable = false)
+    private Boolean active = false;
+
+    @Column(name = "is_deleted", nullable = false)
+    private boolean deleted = false;
+
+    public CreditScorecardFeature() {
+        //
+    }
+
+    public CreditScorecardFeature(String name, org.apache.fineract.portfolio.creditscorecard.domain.FeatureValueType valueType,
+            org.apache.fineract.portfolio.creditscorecard.domain.FeatureDataType dataType,
+            org.apache.fineract.portfolio.creditscorecard.domain.FeatureCategory category, Boolean active) {
+        this.name = name;
+        this.valueType = valueType.getValue();
+        this.dataType = dataType.getValue();
+        this.category = category.getValue();
+        this.active = active;
+    }
+
+    public static CreditScorecardFeature fromJson(JsonCommand command) {
+        final String name = command.stringValueOfParameterNamed("name");
+        final org.apache.fineract.portfolio.creditscorecard.domain.FeatureValueType valueType = org.apache.fineract.portfolio.creditscorecard.domain.FeatureValueType

Review comment:
       Here too




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] github-actions[bot] commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-1037599918


   This pull request seems to be stale.  Are you still planning to work on it?  We will automatically close it in 30 days.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vidakovic commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
vidakovic commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-1084284194


   Closing because it looks abandoned.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] xurror commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
xurror commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-899239552


   I think there was the idea of making it a microservice, that's why we have a seperate repository where the module server is hosted so it can be run independently.
   Some changes feature here because the first level of integration of the project was focused on it's usability with Fineract 1.x.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] BLasan commented on a change in pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
BLasan commented on a change in pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#discussion_r748740903



##########
File path: fineract-provider/src/main/java/org/apache/fineract/portfolio/creditscorecard/domain/CreditScorecardFeature.java
##########
@@ -0,0 +1,166 @@
+/**
+ * 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.fineract.portfolio.creditscorecard.domain;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Table;
+import org.apache.fineract.infrastructure.core.api.JsonCommand;
+import org.apache.fineract.infrastructure.core.data.EnumOptionData;
+import org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
+import org.apache.fineract.portfolio.creditscorecard.data.CreditScorecardFeatureData;
+import org.apache.fineract.portfolio.creditscorecard.service.CreditScorecardEnumerations;
+
+@Entity
+@Table(name = "m_credit_scorecard_feature")
+public class CreditScorecardFeature extends AbstractPersistableCustom implements Serializable {
+
+    @Column(name = "name", length = 100, unique = true, nullable = false)
+    private String name;
+
+    @Column(name = "value_type_enum", nullable = false)
+    private Integer valueType;
+
+    @Column(name = "data_type_enum", nullable = false)
+    private Integer dataType;
+
+    @Column(name = "category_enum", nullable = false)
+    private Integer category;
+
+    @Column(name = "is_active", nullable = false)
+    private Boolean active = false;
+
+    @Column(name = "is_deleted", nullable = false)
+    private boolean deleted = false;
+
+    public CreditScorecardFeature() {
+        //
+    }
+
+    public CreditScorecardFeature(String name, org.apache.fineract.portfolio.creditscorecard.domain.FeatureValueType valueType,
+            org.apache.fineract.portfolio.creditscorecard.domain.FeatureDataType dataType,
+            org.apache.fineract.portfolio.creditscorecard.domain.FeatureCategory category, Boolean active) {
+        this.name = name;
+        this.valueType = valueType.getValue();
+        this.dataType = dataType.getValue();
+        this.category = category.getValue();
+        this.active = active;
+    }
+
+    public static CreditScorecardFeature fromJson(JsonCommand command) {
+        final String name = command.stringValueOfParameterNamed("name");
+        final org.apache.fineract.portfolio.creditscorecard.domain.FeatureValueType valueType = org.apache.fineract.portfolio.creditscorecard.domain.FeatureValueType
+                .fromInt(command.integerValueOfParameterNamed("valueType"));
+        final org.apache.fineract.portfolio.creditscorecard.domain.FeatureDataType dataType = org.apache.fineract.portfolio.creditscorecard.domain.FeatureDataType
+                .fromInt(command.integerValueOfParameterNamed("dataType"));
+        final org.apache.fineract.portfolio.creditscorecard.domain.FeatureCategory category = org.apache.fineract.portfolio.creditscorecard.domain.FeatureCategory
+                .fromInt(command.integerValueOfParameterNamed("category"));
+        final boolean active = command.booleanPrimitiveValueOfParameterNamed("active");
+
+        return new CreditScorecardFeature(name, valueType, dataType, category, active);
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public EnumOptionData getValueType() {
+        return CreditScorecardEnumerations.featureValueType(valueType);
+    }
+
+    public EnumOptionData getDataType() {
+        return CreditScorecardEnumerations.featureDataType(dataType);
+    }
+
+    public EnumOptionData getCategory() {
+        return CreditScorecardEnumerations.featureCategory(category);
+    }
+
+    public boolean isActive() {
+        return this.active;
+    }
+
+    public boolean isDeleted() {
+        return this.deleted;
+    }
+
+    /**
+     * Delete is a <i>soft delete</i>. Updates flag on feature so it wont appear in query/report results.
+     *
+     * Any fields with unique constraints and prepended with id of record.
+     */
+    public void delete() {
+        this.deleted = true;
+        this.name = getId() + "_" + this.name;
+    }
+
+    public CreditScorecardFeatureData toData() {
+        final EnumOptionData valueType = CreditScorecardEnumerations.featureValueType(this.valueType);
+        final EnumOptionData dataType = CreditScorecardEnumerations.featureDataType(this.dataType);
+        final EnumOptionData category = CreditScorecardEnumerations.featureCategory(this.category);
+
+        return CreditScorecardFeatureData.instance(null, getId(), this.name, valueType, dataType, category, this.active, null, null, null,

Review comment:
       Can't we write a overloaded method for `CreditScorecardFeatureData.instance` instead of passing many `null`s? Just an idea :) 




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] xurror commented on pull request #1811: FINCN-252 Machine Learning Scorecard for Credit Risk Assessment Phase 4

Posted by GitBox <gi...@apache.org>.
xurror commented on pull request #1811:
URL: https://github.com/apache/fineract/pull/1811#issuecomment-945379809


   The PR is good now. Please review when you can.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org