{"id":46716,"date":"2022-09-17T00:00:00","date_gmt":"2022-09-17T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/"},"modified":"2025-11-13T12:56:09","modified_gmt":"2025-11-13T20:56:09","slug":"fraudulent-transactions-using-machine-learning-java-and-griddb","status":"publish","type":"post","link":"https:\/\/griddb.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/","title":{"rendered":"Fraudulent Transactions using Machine Learning, Java, and GridDB"},"content":{"rendered":"<p>In today&#8217;s world, financial data is the new currency in the finance world. However, it is becoming harder and harder to use traditional statistical methods to process financial data that is ever more expanding. Machine learning provides a set of techniques and modules that enable the creation of programs that predict financial data in the form of company value, stock prices, or even detecting a case of financial fraud.<\/p>\n<p>This article describes the creation of a decision tree that enables the detection of fraudulent transactions used by customers using credit card transactions. The report covers the decision tree implementation using Java programming. The article starts by covering the main requirements of the machine learning algorithms. Next, the article describes the dataset and its main components. Later, the decision tree is implemented using a decision tree. Last, <strong>GridDB<\/strong> read, write, and store methods are implemented to store our data for deployment and testing purposes.<\/p>\n<p><a href=\"https:\/\/github.com\/SimoCs\/Fraudulent-Transactions-Java\"> Full Source Code Here <\/a><\/p>\n<h2>Requirements<\/h2>\n<p>In this section, we will cover the main libraries, modules, and database environment used to demonstrate the usage of machine learning to detect fraudulent credit card transactions.<\/p>\n<p><strong>Weka 3.9<\/strong>: Download and position the <strong>weka.jar<\/strong> file in the following path: <em>\/usr\/share\/java\/<\/em>.<\/p>\n<p><strong>GridDB 4.6<\/strong>: Make sure to activate the <strong>GridDB<\/strong> cluster after installation.<\/p>\n<p>It is critical to place the <strong>Weka Jar<\/strong> file in the <strong>CLASSPATH<\/strong> of your environment. The same applies to the <strong>GridStore Jar<\/strong> file to ensure the <strong>GridDB<\/strong> database is up and running.<\/p>\n<p>To perform this task, please use the following command lines:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">$ export CLASSPATH=${CLASSPATH}:\/usr\/share\/java\/weka.jar\n$ export CLASSPATH=$CLASSPATH:\/usr\/share\/java\/gridstore.jar<\/code><\/pre>\n<\/div>\n<h2>The Dataset<\/h2>\n<p>For demonstration purposes, we have chosen a sample dataset that contains credit card transactions. This dataset is available at the following link <a href=\"https:\/\/raw.githubusercontent.com\/SimoCs\/Fraudulent-Transactions-Java\/main\/creditcard.csv\">here<\/a>. The dataset is composed of <strong>9999<\/strong> instances with <strong>31<\/strong> attributes that are detailed as follows:<\/p>\n<ol>\n<li><strong>Time<\/strong>. Measures the number of seconds that passed between every credit card transaction.<\/li>\n<li><strong>V1 to V28<\/strong>. Measures the credit card user identifiers that are anonymized for privacy reasons.<\/li>\n<li><strong>Amount<\/strong>. Measures the transaction amount in dollars. <\/li>\n<li><strong>Class<\/strong>: Indicates the transaction type, and this attribute takes two possible values: <strong>0<\/strong> not fraudulent, <strong>1<\/strong> fraudulent.<\/li>\n<\/ol>\n<p>Here is an extract of the dataset:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">\"Time\",\"V1\",\"V2\",\"V3\",\"V4\",\"V5\",\"V6\",\"V7\",\"V8\",\"V9\",\"V10\",\"V11\",\"V12\",\"V13\",\"V14\",\"V15\",\"V16\",\"V17\",\"V18\",\"V19\",\"V20\",\"V21\",\"V22\",\"V23\",\"V24\",\"V25\",\"V26\",\"V27\",\"V28\",\"Amount\",\"Class\"\n\n0,-1.3598071336738,-0.0727811733098497,2.53634673796914,1.37815522427443,-0.338320769942518,0.462387777762292,0.239598554061257,0.0986979012610507,0.363786969611213,0.0907941719789316,-0.551599533260813,-0.617800855762348,-0.991389847235408,-0.311169353699879,1.46817697209427,-0.470400525259478,0.207971241929242,0.0257905801985591,0.403992960255733,0.251412098239705,-0.018306777944153,0.277837575558899,-0.110473910188767,0.0669280749146731,0.128539358273528,-0.189114843888824,0.133558376740387,-0.0210530534538215,149.62,\"0\"<\/code><\/pre>\n<\/div>\n<p>The dataset used in our article is a comma-separated values file stored on the project resource page. Using Java, the data processing code will start by reading the file path and using a scanner method to read the data and storing the data in primary memory. The following Java snippet performs what has been explained above:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\/\/ Handling Dataset and storage to GridDB\nFile data = new File(\"\/home\/ubuntu\/griddb\/gsSample\/creditcard.csv\");\nScanner sc = new Scanner(data);  \nsc.useDelimiter(\"n\");\n\nwhile (sc.hasNext())  \/\/ Returns a boolean value  \n{ \n    int i = 0;\n    Row row = collection.createRow();\n\n    String line = sc.next();\n    String columns[] = line.split(\",\");\n\n    int Time = Integer.parseInt(columns[0]);\n\n    float V1 = Float.parseFloat(columns[1]);\n    float V2 = Float.parseFloat(columns[2]);\n    float V3 = Float.parseFloat(columns[3]);\n    float V4 = Float.parseFloat(columns[4]);\n    float V5 = Float.parseFloat(columns[5]);\n    float V6 = Float.parseFloat(columns[6]);\n    float V7 = Float.parseFloat(columns[7]);\n    float V8 = Float.parseFloat(columns[8]);\n    float V9 = Float.parseFloat(columns[9]);\n    float V10 = Float.parseFloat(columns[10]);\n    float V11 = Float.parseFloat(columns[11]);\n    float V12 = Float.parseFloat(columns[12]);\n    float V13 = Float.parseFloat(columns[13]);\n    float V14 = Float.parseFloat(columns[14]);\n    float V15 = Float.parseFloat(columns[15]);\n    float V16 = Float.parseFloat(columns[16]);\n    float V17 = Float.parseFloat(columns[17]);\n    float V18 = Float.parseFloat(columns[18]);\n    float V19 = Float.parseFloat(columns[19]);\n    float V20 = Float.parseFloat(columns[20]);\n    float V21 = Float.parseFloat(columns[21]);\n    float V22 = Float.parseFloat(columns[22]);\n    float V23 = Float.parseFloat(columns[23]);\n    float V24 = Float.parseFloat(columns[24]);\n    float V25 = Float.parseFloat(columns[25]);\n    float V26 = Float.parseFloat(columns[26]);\n    float V27 = Float.parseFloat(columns[27]);\n    float V28 = Float.parseFloat(columns[28]);\n\n    int Amount = Integer.parseInt(columns[29]);\n    int Class = Integer.parseInt(columns[30]);\n\n    row.setInteger(0,i);\n    row.setInteger(1, Time);\n\n    row.setFloat(2, V1);\n    row.setFloat(3, V2);\n    row.setFloat(4, V3);\n    row.setFloat(5, V4);\n    row.setFloat(6, V5);\n    row.setFloat(7, V6);\n    row.setFloat(8, V7);\n    row.setFloat(9, V8);\n    row.setFloat(10, V9);\n    row.setFloat(11, V10);\n    row.setFloat(12, V11);\n    row.setFloat(13, V12);\n    row.setFloat(14, V13);\n    row.setFloat(15, V14);\n    row.setFloat(16, V15);\n    row.setFloat(17, V16);\n    row.setFloat(18, V17);\n    row.setFloat(19, V18);\n    row.setFloat(20, V19);\n    row.setFloat(21, V20);\n    row.setFloat(22, V21);\n    row.setFloat(23, V22);\n    row.setFloat(24, V23);\n    row.setFloat(25, V24);\n    row.setFloat(26, V25);\n    row.setFloat(27, V26);\n    row.setFloat(28, V27);\n    row.setFloat(29, V28);\n    row.setFloat(30, V28);\n\n    row.setInteger(31,Amount);\n    row.setInteger(32,Class);\n\n    rowList.add(row);\n\n    i++;\n}<\/code><\/pre>\n<\/div>\n<p>Once the data was retrieved from our dataset file, it is critical to close the scanner used to process the data using the following Java statement:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">sc.close();<\/code><\/pre>\n<\/div>\n<p>The decision tree is implemented to predict the credit card transactions that are considered fraudulent. In the subsequent section, we will implement the decision tree algorithm written in Java.t<\/p>\n<h2>Implementing a Decision Tree Algorithm in Java<\/h2>\n<p>We will use the <strong>J48<\/strong> algorithm in the Weka package to implement our decision tree. The decision tree generated is known as a <strong>C4.5<\/strong> decision tree, which can either be pruned or unpruned. To start the implementation process, we will begin by importing all the needed libraries.<\/p>\n<p>The following is the list of libraries used to implement our decision tree:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">import weka.core.Instances;\nimport weka.core.converters.ConverterUtils.DataSource;\nimport weka.classifiers.trees.J48;\nimport weka.classifiers.Evaluation;<\/code><\/pre>\n<\/div>\n<p>Our decision tree can be configured using the options argument. The following is a series of default changes that can be implemented to make sure our decision tree accepts a high number of instances.<\/p>\n<p>The following is the Java code is used to change these settings:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">String[] options = new String[4];\noptions[0] = \"-C\";\noptions[1] = \"0.25\";\noptions[2] = \"-M\";  \noptions[3] = \"30\";<\/code><\/pre>\n<\/div>\n<h2>Import Packages<\/h2>\n<p>We need a set of libraries to ensure our dataset is processed using Java. These libraries are going to serve as a storage area in our program. The initial libraries that will be imported are <strong>ArrayList<\/strong> and <strong>List<\/strong> modules.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">import java.util.ArrayList;\nimport java.util.List;<\/code><\/pre>\n<\/div>\n<p>Additionally, we will need to import two extra libraries, <strong>Properties<\/strong> and <strong>Random<\/strong>, used to process our <strong>GridDB<\/strong> store.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">import java.util.Properties;\nimport java.util.Random;<\/code><\/pre>\n<\/div>\n<p>Next are the libraries needed to implement the <strong>GridDB<\/strong> interface.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">import com.toshiba.mwcloud.gs.Collection;\nimport com.toshiba.mwcloud.gs.ColumnInfo;\nimport com.toshiba.mwcloud.gs.Container;\nimport com.toshiba.mwcloud.gs.ContainerInfo;\nimport com.toshiba.mwcloud.gs.GSType;\nimport com.toshiba.mwcloud.gs.GridStore;\nimport com.toshiba.mwcloud.gs.GridStoreFactory;\nimport com.toshiba.mwcloud.gs.Query;\nimport com.toshiba.mwcloud.gs.Row;\nimport com.toshiba.mwcloud.gs.RowSet;<\/code><\/pre>\n<\/div>\n<p>Finally, we import packages to interact with our <strong>CreditCard<\/strong> CSV file.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">import java.io.IOException;\nimport java.util.Scanner;\nimport java.io.File;\nimport java.io.BufferedReader;\nimport java.io.FileReader;<\/code><\/pre>\n<\/div>\n<h2>Write Data into GridDB<\/h2>\n<p>To store our credit card data in our <strong>GridDB<\/strong> database, we start by instantiating the connection object to a predefined server. In addition, we initialize the <strong>GridStore<\/strong> class using the <strong>getInstance()<\/strong> method.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\/\/ Manage connection to GridDB\nProperties prop = new Properties();\n      \nprop.setProperty(\"notificationAddress\", \"239.0.0.1\");\nprop.setProperty(\"notificationPort\", \"31999\");\nprop.setProperty(\"clusterName\", \"cluster\");\nprop.setProperty(\"database\", \"public\");\nprop.setProperty(\"user\", \"admin\");\nprop.setProperty(\"password\", \"admin\");\n\n\/\/ Get Store and Container\nGridStore store = GridStoreFactory.getInstance().getGridStore(prop);\nstore.getContainer(\"newContainer\");\nString containerName = \"mContainer\";<\/code><\/pre>\n<\/div>\n<p>Once our object was created, we started by extracting our columns from our dataset. This can be done using the <strong>add()<\/strong> method.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\/\/ Define container schema and columns\nContainerInfo containerInfo = new ContainerInfo();\nList&lt;columninfo> columnList = new ArrayList&lt;\/columninfo>&lt;columninfo>();\n\ncolumnList.add(new ColumnInfo(\"key\", GSType.INTEGER));\ncolumnList.add(new ColumnInfo(\"Time\", GSType.INTEGER));\n\ncolumnList.add(new ColumnInfo(\"V1\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V2\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V3\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V4\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V5\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V6\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V7\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V8\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V9\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V10\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V11\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V12\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V13\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V14\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V15\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V16\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V17\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V18\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V19\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V20\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V21\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V22\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V23\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V24\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V25\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V26\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V27\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"V28\", GSType.FLOAT));\n\ncolumnList.add(new ColumnInfo(\"Amount\", GSType.FLOAT));\ncolumnList.add(new ColumnInfo(\"Class\", GSType.INTEGER));\n\ncontainerInfo.setColumnInfoList(columnList);\ncontainerInfo.setRowKeyAssigned(true);&lt;\/columninfo><\/code><\/pre>\n<\/div>\n<h2>Store the Data in GridDB<\/h2>\n<p>Once we have processed the dataset using Java programming, we move to the next set, storing our dataset for long-term use in our database. This is where <strong>GridDB<\/strong> becomes very handy, as we will keep each one of our columns in a predefined row.<\/p>\n<p>The following Java code snippet is used to conduct that task:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">row.setInteger(0,i);\nrow.setInteger(1, Time);\n\nrow.setFloat(2, V1);\nrow.setFloat(3, V2);\nrow.setFloat(4, V3);\nrow.setFloat(5, V4);\nrow.setFloat(6, V5);\nrow.setFloat(7, V6);\nrow.setFloat(8, V7);\nrow.setFloat(9, V8);\nrow.setFloat(10, V9);\nrow.setFloat(11, V10);\nrow.setFloat(12, V11);\nrow.setFloat(13, V12);\nrow.setFloat(14, V13);\nrow.setFloat(15, V14);\nrow.setFloat(16, V15);\nrow.setFloat(17, V16);\nrow.setFloat(18, V17);\nrow.setFloat(19, V18);\nrow.setFloat(20, V19);\nrow.setFloat(21, V20);\nrow.setFloat(22, V21);\nrow.setFloat(23, V22);\nrow.setFloat(24, V23);\nrow.setFloat(25, V24);\nrow.setFloat(26, V25);\nrow.setFloat(27, V26);\nrow.setFloat(28, V27);\nrow.setFloat(29, V28);\nrow.setFloat(30, V28);\n\nrow.setInteger(31,Amount);\nrow.setInteger(32,Class);\n\nrowList.add(row);<\/code><\/pre>\n<\/div>\n<p>To commit our changes to our GridDB database, we can use the <strong>put()<\/strong> method that takes the rows of our database as an argument.<\/p>\n<p>The following code is used to perform this task:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">collection.put(rowList);<\/code><\/pre>\n<\/div>\n<h2>Retrieve the Data from GridDB<\/h2>\n<p>To retrieve the instances of our store data found in our database, we will have to use the <strong>SELECT<\/strong> query to fetch the needed rows and columns from our <strong>GridDB<\/strong> database.<\/p>\n<p>The following is a code snippet that performs the above explained task:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">Query&lt;row> query = container.query(\"SELECT * \");\nRowSet&lt;\/row>&lt;row> rs = query.fetch();&lt;\/row><\/code><\/pre>\n<\/div>\n<p>We can use the <strong>println()<\/strong> method found in Java to view our data. This task can be performed as follows:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">\/\/ Print GridDB data\nwhile (rs.hasNext()) {\n    Row row = rs.next();\n\n    System.out.println(\" Row=\" + row);\n}<\/code><\/pre>\n<\/div>\n<h2>Build the Decision Tree<\/h2>\n<p>After ensuring our data is securely saved in our <strong>GridDB<\/strong> database, we can process by running our decision tree algorithm and using Java to determine our model&#8217;s accuracy. In our Java program, we can use the method <strong>Instances()<\/strong> to convert our data to a suitable machine learning data model that can be there after used to create our decision tree.<\/p>\n<p>The following code can be used to perform that task:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">BufferedReader bufferedReader= new BufferedReader(new FileReader(res));\nInstances datasetInstances= new Instances(bufferedReader);<\/code><\/pre>\n<\/div>\n<p>Once our data is ready after being converted to ready-to-use instances, we will use the <strong>buildClassifer()<\/strong> method to create our machine learning model. The following model is used to build our decision tree:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">mytree.buildClassifier(datasetInstances);<\/code><\/pre>\n<\/div>\n<p>After running our machine learning model, it is critical to ensure our model is working correctly determining its accuracy. These tasks can be accomplished during the cross-validation model.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">Evaluation eval = new Evaluation(datasetInstances);  \neval.crossValidateModel(mytree, datasetInstances, 10, new Random(1));<\/code><\/pre>\n<\/div>\n<p>We observe in the last line of code that we perform a cross validation to our data instances. This process will ensure that the dataset is split in different ways to obtain unbiased results, especially since we count on a limited dataset.<\/p>\n<p>Finally, we print the summary of our model as follows:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">System.out.println(eval.toSummaryString(\"n === Summary === n\", true));<\/code><\/pre>\n<\/div>\n<h2>Compile and Run the Code<\/h2>\n<p>To compile and run the code, we will start by locating the <strong>FraudulentTransactions.java<\/strong> file found in the <strong>gsSample\/<\/strong> path. Once the folder is located, make sure to expect the following commands to run your Java code and compile your results:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">~\/griddb$ javac gsSample\/FraudulentTransactions.java\n~\/griddb$ java gsSample\/FraudulentTransactions.java<\/code><\/pre>\n<\/div>\n<h2>Conclusion<\/h2>\n<p>The following is the summary of the results we produced using our decision tree algorithms using our Java program:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-sh\">=== Summary ===\n\nCorrelation coefficient                  0.7445\nMean absolute error                      0.0009\nRoot mean squared error                  0.0296\nRelative absolute error                 25.4503 %\nRoot relative squared error             71.3443 %<\/code><\/pre>\n<\/div>\n<p>As we demonstrated, the decision tree has resulted in an accuracy of <strong>71&#46;34%<\/strong> in classifying fraudulent credit card transactions. To increase the accuracy of our model and reach better accuracy, it is advisable to increase the size of our dataset to enable the module to learn the different fraudulent transactions.<\/p>\n<p>Make sure to close the <strong>query<\/strong>, the <strong>container<\/strong>, and the <strong>GridDB<\/strong> database:<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-java\">query.close();\ncontainer.close();\nstore.close();<\/code><\/pre>\n<\/div>\n<p><a href=\"https:\/\/github.com\/SimoCs\/Fraudulent-Transactions-Java\"> Full Source Code Here <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In today&#8217;s world, financial data is the new currency in the finance world. However, it is becoming harder and harder to use traditional statistical methods to process financial data that is ever more expanding. Machine learning provides a set of techniques and modules that enable the creation of programs that predict financial data in the [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":28075,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46716","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Fraudulent Transactions using Machine Learning, Java, and GridDB | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"In today&#039;s world, financial data is the new currency in the finance world. However, it is becoming harder and harder to use traditional statistical\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fraudulent Transactions using Machine Learning, Java, and GridDB | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"In today&#039;s world, financial data is the new currency in the finance world. However, it is becoming harder and harder to use traditional statistical\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-17T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:56:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb.net\/wp-content\/uploads\/2022\/02\/bank_2560x1707.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1707\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"griddb-admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Fraudulent Transactions using Machine Learning, Java, and GridDB\",\"datePublished\":\"2022-09-17T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:56:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/\"},\"wordCount\":1199,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2022\/02\/bank_2560x1707.jpeg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/\",\"name\":\"Fraudulent Transactions using Machine Learning, Java, and GridDB | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2022\/02\/bank_2560x1707.jpeg\",\"datePublished\":\"2022-09-17T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:56:09+00:00\",\"description\":\"In today's world, financial data is the new currency in the finance world. However, it is becoming harder and harder to use traditional statistical\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2022\/02\/bank_2560x1707.jpeg\",\"contentUrl\":\"\/wp-content\/uploads\/2022\/02\/bank_2560x1707.jpeg\",\"width\":2560,\"height\":1707},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"caption\":\"griddb-admin\"},\"url\":\"https:\/\/griddb.net\/en\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fraudulent Transactions using Machine Learning, Java, and GridDB | GridDB: Open Source Time Series Database for IoT","description":"In today's world, financial data is the new currency in the finance world. However, it is becoming harder and harder to use traditional statistical","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/","og_locale":"en_US","og_type":"article","og_title":"Fraudulent Transactions using Machine Learning, Java, and GridDB | GridDB: Open Source Time Series Database for IoT","og_description":"In today's world, financial data is the new currency in the finance world. However, it is becoming harder and harder to use traditional statistical","og_url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2022-09-17T07:00:00+00:00","article_modified_time":"2025-11-13T20:56:09+00:00","og_image":[{"width":2560,"height":1707,"url":"https:\/\/griddb.net\/wp-content\/uploads\/2022\/02\/bank_2560x1707.jpeg","type":"image\/jpeg"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"griddb-admin","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#article","isPartOf":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Fraudulent Transactions using Machine Learning, Java, and GridDB","datePublished":"2022-09-17T07:00:00+00:00","dateModified":"2025-11-13T20:56:09+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/"},"wordCount":1199,"commentCount":0,"publisher":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2022\/02\/bank_2560x1707.jpeg","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/","name":"Fraudulent Transactions using Machine Learning, Java, and GridDB | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#primaryimage"},"image":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2022\/02\/bank_2560x1707.jpeg","datePublished":"2022-09-17T07:00:00+00:00","dateModified":"2025-11-13T20:56:09+00:00","description":"In today's world, financial data is the new currency in the finance world. However, it is becoming harder and harder to use traditional statistical","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/fraudulent-transactions-using-machine-learning-java-and-griddb\/#primaryimage","url":"\/wp-content\/uploads\/2022\/02\/bank_2560x1707.jpeg","contentUrl":"\/wp-content\/uploads\/2022\/02\/bank_2560x1707.jpeg","width":2560,"height":1707},{"@type":"WebSite","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#website","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","caption":"griddb-admin"},"url":"https:\/\/griddb.net\/en\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/46716","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/comments?post=46716"}],"version-history":[{"count":1,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/46716\/revisions"}],"predecessor-version":[{"id":51388,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/posts\/46716\/revisions\/51388"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/media\/28075"}],"wp:attachment":[{"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/media?parent=46716"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/categories?post=46716"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb.net\/en\/wp-json\/wp\/v2\/tags?post=46716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}