ATM is an electronic communication device that allows customers of financial institutions to directly engage in financial transactions such as cash withdrawals, deposits, fund transfers, books and account information at any time through bank employees.
We made a ATM system using Python 3. We are working on this project to develop ATM to learn the same functions as cache memory, write clean codes, and think and grow with team members. The ATM has created functions such as register, login, deposit, withdrawal, loan, transfer, balance inquiry, credit inquiry, customized recommendation system, etc. To create these features, we implemented encryption, simple linear regression, and LRU cache memory to create more complete ATM.
A regression model with one response variable and a linear regression function is called simple linear regression. We used ATMs to determine users' credit ratings and to recommend a banking system suitable for them.
Astro Secret operates based on base64. Due to the nature of two-way encryption, we added a specific string value to secure the disadvantage of longer encrypted strings. Also, we applied sha256, or one-way encryption, for passwords that do not require decryption.
We used a customized encryption method to encrypt values that need to be decrypted, such as names and balance information. Here's how it works:
- Encoding the entered string as base64.
- Add a random string to fit the position.
- Finalize encryption by re-encoding the added string. The encoding function then returns the key and encoding values together.
Passwords don't need to be decoded. That means you don't have to create a decryption key. Therefore, we implemented password encryption using One-Way Encryption (SHA-256).
Regression is a data analysis method in which the dependent variable Y is represented by the different variables X1,.., and Xp. The response variable is an explanatory variable, and the variables used for explanation are called independent variables. Regression analysis is intended to logically explain the prediction of a response variable by an independent variable or the relationship between an independent variable and a response variable.
A regression model with one response variable and a linear regression function is called simple linear regression. We used ATMs to determine users' credit ratings and to recommend a banking system suitable for them.
First, data on the user's age and credit rating are used to determine whether the user's credit rating is high or low. Recommendations require the creation of a coordinate plane, whose x-axis becomes old and the y-axis becomes the user's property. When the first function straight line is derived from the simple linear regression analysis using the partial differential equation, the slope is the sum of the times of the x,y deviations / X deviation squared, and the Ysection is the Ymean-(Xmean*m). Finally, when the user's amount and age are added to the function to make a dot in the coordinate plane, it is calculated that the credit rating is good if it is above the straight line derived, and the credit rating is low if it is below the straight line. It is easy to control according to the procedure below.x_regressor = Read_value[x]
y_response = [int(Decoding(Read_value[key_y].iloc[i], Read_value[y].iloc[i]))
for i in range(len(Read_value.index))]
x_avg = np.mean(x_regressor)
y_avg = np.mean(y_response)
Sxx = np.sum((x_regressor-x_avg)**2)
Syy = np.sum((y_response-y_avg)**2)
Sxy = np.sum((x_regressor-x_avg) * (y_response-y_avg))
m = Sxy/Sxx
b = y_avg - x_avg * m
if y_compare >= x_compare * m + b:
return 1
else:
return 0
When I executed the code above,
First, In x_regressor variable, enter dependent variable values, and in y_response variable, enter response variable values.
Second, for the x_avg variable, enter the mean of the x_regressor values, and for the y_avg variable, enter the mean of the y_response values.
Third, because the sum of the squared deviations is the sum of the squared values after subtracting the mean from the value, the sum of the deviations of the x,y values for Sxy,the sum of the squares of the x deviations for Sxx, and the sum of the squares of the y deviations for Syy.
Fourth, we derive the slope and the y-section using the partial differential equation.
The slope is Sxy / Sxx, and the y section is y_avg - (x_avg * m).
Finally, when dotting (x_compare, y_compare) the coordinate plane, if above the straight line derived from the regression analysis, returns "high income level" and "low income level" if below the straight line.
Cache memory is a high-speed semiconductor memory that is installed between CPU and main memory.
It is often useful to have these things in memory. Of course, it is desirable to ensure that the capacity of cache memory does not become too large, as it slows down as capacity increases.
This module provides such a cache.
In most cases, the following may be used:
Default nodeMap form : nodeMap = {key: [value, count]}
The functions of the module are as follows.
what it does | FUnc | Remark |
---|---|---|
Search value in the Queue | get(key) | Return value in 'key' |
Put value in the Queue | put(key, value) | Add 'value' corresponding to 'key' |
from LRUCache import * # import module
lru = LRUCache(2) # Set Cache Size (args: int)
lru.put(1, 1) # put(key, value)
print(lru.get(1)) # get(key)
print(lru.nodeMap) # print nodeMap
This is a simple use.
An example of using this is as follows.
from LRUCache import *
lru = LRUCache(2)
if __name__ == "__main__":
lru.put(1, 1)
lru.put(2, 2)
print(lru.get(1)) # returns 1
lru.put(3, 3) # evicts key 2
print(lru.get(2)) # returns -1 (not found)
lru.put(4, 4) # evicts key 1
print(lru.get(1)) # returns -1 (not found)
print(lru.get(3)) # returns 3
print(lru.get(4)) # returns 4
print(lru.nodeMap) # show nodeMap
By default, this cache only expires each time an item is stabbed, and all methods in this class are cleaned up.