I'm new. Hopefully this is an appropriate question for this forum.
(This is a simplified example).
I want to write a smart contract that receives a loan request, and based on certain features of loan requestor decides the amount of loan to provide.
The evaluation function (pseudocode) would look like this:
loan_amount = W1 * X1 + W2 * X2
X1 and X2 are "features" of the reqeustor address. For example, - X1=average ETH balance for last 3 month - X2=average monthly ETH deposits.
W1 and W2 are weights for (or importance to attach to) these features.
Assume W1 and W2 are calculated by a regression/machine learning model offline. (Assume this ML model has access to loan defaults by various addresses and also average balances and deposits into those addresses).
So the above smart contract needs to (1) obtain W1, W2 from the ML model and (2) obtain X1 and X2 somehow (directly from the blockchain ? some API? some saved database on IFPS).
How could this be done? I mean how will the smart contract access these "outside" resources?
(Please note I understand the ETH architecture at a fundamental level, but am new to solidity and decentralized system development - having created a few simple smart contracts following tutorials. I am fairly competent with datascience in python/matlab).
Your help most appreciated!