{"id":296,"date":"2017-04-27T14:35:47","date_gmt":"2017-04-27T14:35:47","guid":{"rendered":"http:\/\/techblog.foreks.com\/?p=296"},"modified":"2024-07-02T13:00:58","modified_gmt":"2024-07-02T13:00:58","slug":"radial-basis-function-neural-network-scala-implementation","status":"publish","type":"post","link":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/","title":{"rendered":"Radial Basis Function Neural Network Scala Implementation"},"content":{"rendered":"<p><center><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-304 alignleft\" src=\"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/image35_65-300x185.png\" alt=\"\" width=\"305\" height=\"226\" align=\"middle\" \/><\/center><\/p>\n<p>In this post, I am going to demonstrate a two-step Scala implementation of Radial Basis Function Neural Network (RBFNetwork): (unsupervised) k-means clustering first, and (supervised) gradient descent second. This two-step implementation is fast and efficient compared to Multilayer Perceptron while providing good predictive performance. This is because unsupervised learning at the first step provides information about data distribution so that the second step can have an intuition about the data and fine-tune the model.<\/p>\n<p>For us, most of the Machine Learning models that we use today are just black box approaches that we take from some library. It is good to have this ability for faster development; however, it would be nicer to know internal dynamics of their implementations. Therefore, I am hoping that this post will be simple enough to provide you that information.<\/p>\n<p><!--more--><\/p>\n<h2><strong>Implementation<\/strong><\/h2>\n<p>Let&#8217;s start with introducing the abstractions that we are going to use for the rest of the code.<\/p>\n<h3>Function Aliases<\/h3>\n<p>Since the most granular abstraction is a function, here below we are going to name them based on their actual job in this implementation:<\/p>\n<div class=\"CodeMirror cm-s-default\">\n<div class=\"CodeMirror-scroll\">\n<div class=\"CodeMirror-sizer\">\n<div class=\"CodeMirror-lines\">\n<div class=\"CodeMirror-code\">\n<div class=\"CodeMirror-gutter-wrapper\"><!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">type Features = IndexedSeq[Double]\ntype DistanceFunc = ((IndexedSeq[Double], IndexedSeq[Double]) =&gt; Double)\ntype RadialBasisFunction = (IndexedSeq[Double] =&gt; Double)\ntype Clustering = () =&gt; IndexedSeq[(Features, IndexedSeq[Features])]<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This definition is useful since it lets us write more readable code. Remember:\u00a0we write code for humans to understand, assuming that the computer somehow is going to understand it anyway. For example, you can read the above code like this:<\/p>\n<p>Distance is a function that takes two points from <em>n<\/em>-dimensional space specified with\u00a0<code>IndexedSeq<\/code>&#8216;s size\u00a0and produces an output metric of type double.<\/p>\n<p>Let&#8217;s move forward with introducing higher-level abstractions like traits.<\/p>\n<h3>Traits<\/h3>\n<p>You can think of a trait as a recipe for doing something; however, it is not something by itself. It is preferable over abstract classes when you want to take advantage of mixing classes, but the end goal is the same: you want to have a resuable set of behaviors somewhere in your code that you can use anytime to add any class that conforms to the protocol that you declare within the trait. An example of this would be gradient descent. It can actually optimize a lot of Machine Learning algorithms, not just neural networks or something else. Therefore, we can think of it as a recipe for optimizing a neural network algorithm. Down below, we define this set of behaviors.<\/p>\n<pre class=\"prettyprint\">import Math.{exp,pow,sqrt}\nimport scala.annotation.tailrec\nimport scala.util.Random\ntrait Optimizer {\n  def fit(dataSet: Iterable[(IndexedSeq[Double], IndexedSeq[Double])], learningRate: Double)\n}\ntrait NeuralNetworkModel extends (IndexedSeq[Double] =&gt; IndexedSeq[Double]) {\n  def getH(input: (IndexedSeq[Double], IndexedSeq[Double])):IndexedSeq[Double]\n}\ntrait EuclideanDistance extends DistanceFunc {\n  override def apply(position1: IndexedSeq[Double], position2: IndexedSeq[Double]): Double = {\n    val sum = position1.zip(position2).map {\n      case (p1, p2) =&gt; \n        val d = p1 - p2\n        pow(d,2)\n    }.sum\n    sqrt(sum)\n  }\n}\ntrait GradientDescent extends Optimizer with NeuralNetworkModel {\n  val nHidden: Int\n  val weights: Array[Double]\n  def fit(trainingData: Iterable[(IndexedSeq[Double], IndexedSeq[Double])], learningRate: Double = 0.1): Unit  = {\n    for(pair &lt;- trainingData){\n      val actual = this(pair._1)\n      val X = getH(pair)\n      val desired = pair._2\n      for( outputIndex &lt;- desired.indices) {\n        val error = desired(outputIndex) - actual(outputIndex)\n        val update = X.indices.map(i =&gt; learningRate * X(i) * error)\n        X.indices.foreach { i =&gt;\n          val weightIndex = (nHidden  * outputIndex) + i\n          weights(weightIndex) = update(i) + weights(weightIndex)\n        }\n        \/\/bias term\n        val weightIndex = (nHidden  * outputIndex) + X.length\n        weights(weightIndex) = learningRate * error + weights(weightIndex)\n      }\n    }\n  }\n}<\/pre>\n<div class=\"CodeMirror cm-s-default\"><\/div>\n<p>We can even think of <em>k<\/em>-means as a trait and change its distance function that it uses for its internal clustering calculation according to the same convention. Down below, we move forward with this.<\/p>\n<div class=\"CodeMirror cm-s-default\">\n<div class=\"CodeMirror-scroll\">\n<div class=\"CodeMirror-sizer\">\n<div>\n<div class=\"CodeMirror-lines\">\n<div>\n<div class=\"CodeMirror-code\">\n<div>\n<div class=\"CodeMirror-gutter-wrapper\"><!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">trait RadialBasisFunctionNetworkTrait extends NeuralNetworkModel {\n  val nIn: Int\n  val nOut: Int\n  val rbfs: IndexedSeq[RadialBasisFunction]\n  val nHidden: Int = rbfs.length + 1\n  val weights: Array[Double] = Array.fill(nHidden * nOut)(scala.math.random)\n  override def getH(input: (IndexedSeq[Double], IndexedSeq[Double])):IndexedSeq[Double] = {\n    rbfs.indices.map { i =&gt; rbfs(i)(input._1) }\n  }\n  override def apply(input: IndexedSeq[Double]): IndexedSeq[Double] = {\n    for (outputIndex &lt;- 0 until nOut) yield {\n      val linearCombination = rbfs.indices.map { i =&gt; rbfs(i)(input) * weights((nHidden * outputIndex) + i)}\n      val bias = weights((nHidden * outputIndex) + rbfs.length)\n      linearCombination.sum + bias\n    }\n  }\n}\nabstract class KMeans(val seed: Int, val k: Int, val eta: Double, val data: Vector[Features]) extends DistanceFunc with Clustering {\n  val rand = new Random(seed)\n  val _data = data\n  val means: Vector[Features] = (0 until k).map(_ =&gt; data(rand.nextInt(data.length))).toVector\n  def apply(): IndexedSeq[(Features, IndexedSeq[Features])] = {\n    @tailrec\n    def _kmeans(means: IndexedSeq[Features]): IndexedSeq[(Features, IndexedSeq[Features])] = {\n      val newMeans: IndexedSeq[(Features, IndexedSeq[Features])] =\n        means.map(mean =&gt; {\n          _data.groupBy(p =&gt; means.minBy(m =&gt; this (m, p))).get(mean) match {\n            case Some(c) =&gt; (c.transpose.map(_.sum).map(x =&gt; x \/ c.length), c)\n            case _ =&gt; (mean, Vector(mean))\n          }\n        })\n      val converged = (means zip newMeans.map(_._1)).forall {\n        case (oldMean, newMean) =&gt; this (oldMean, newMean) &lt;= eta\n      }\n      if (!converged) _kmeans(newMeans.map(_._1)) else newMeans\n    }\n    _kmeans(means)\n  }\n}\ntype ErrorFunc = (NeuralNetworkModel, Iterable[(IndexedSeq[Double], IndexedSeq[Double])]) =&gt; Double<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Let&#8217;s read above code like this: We have a <code>NeuralNetworkModel<\/code>\u00a0that takes an input that consists of features like\u00a0<code>IndexedSeq<\/code>\u00a0and produces target values as again IndexedSeq, this is because neural networks may produce multi outputs like in the case of mutliclass classification. We define this behavior by extending <code>Function[IndexedSeq[Double],IndexedSeq[Double]]<\/code>. It also declares <code>getH<\/code>\u00a0in its protocol, which means that any class that implements this needs to tell how to get hidden values from the pair of input and target values. In the case of <code>RBFNetwork<\/code>\u00a0it applies a Gaussian Function to its inputs in its hidden layer. Therefore, when we call <code>getH<\/code><span id=\"_tmp_pre_7\">,<\/span>\u00a0<code>RBFNetwork<\/code> may want to return these values. Now, let&#8217;s create a K-means implementation that uses Euclidean Distance as a distance function and <code>RBFNetwork<\/code>\u00a0with\u00a0the Gradient Descent optimizer.<\/p>\n<div class=\"CodeMirror cm-s-default\">\n<div class=\"CodeMirror-scroll\">\n<div class=\"CodeMirror-sizer\">\n<div>\n<div class=\"CodeMirror-lines\">\n<div>\n<div class=\"CodeMirror-code\">\n<div>\n<div class=\"CodeMirror-gutter-wrapper\">\u00a0<!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">case class KMeansImpl(override val seed: Int,override val k: Int,override val eta: Double,override val data: Vector[Features]) extends KMeans(seed, k, eta , data)\n        with EuclideanDistance\ncase class RadialBasisFunctionNetwork(nIn: Int, nOut: Int, rbfs: IndexedSeq[RadialBasisFunction]) \n     extends RadialBasisFunctionNetworkTrait\n     with GradientDescent<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>That is it. Let&#8217;s analyze an example of the dataset using this code.<\/p>\n<h2>Inference<\/h2>\n<p>In this example, we have two by 50 training data and two by 100 validation data. The end goal is to construct a regression model. The first column is an input and the second column is a target or in the other words respondent variable. We are going to use Gaussian Function as a Radial Basis Function component for the neural network and use Gradient Descent as an optimizer. To initialize Gaussian Functions&#8217; center and width, we are going to run the K-means algorithm and take means as a center for the Gaussian Function and the maximum distance between cluster elements and its mean as a width for the same function. We are going to run this pipeline with a different amount of Gaussian Experts in the other words with different hidden layer sizes and evaluate their performance so that we can observe one underfitting model, one overfitting model, and one good fit model.<\/p>\n<div class=\"CodeMirror cm-s-default\">\n<div class=\"CodeMirror-scroll\">\n<div class=\"CodeMirror-sizer\">\n<div class=\"CodeMirror-lines\">\n<div class=\"CodeMirror-code\">\n<div class=\"CodeMirror-gutter-wrapper\"><!--?prettify linenums=true?--><\/p>\n<pre class=\"prettyprint\">def trainAndGetModel(rbfCount: Int, training:Vector[(Vector[Double], Vector[Double])]) = {\n    val kmeansImpl = KMeansImpl(seed = 1990, k = rbfCount, eta = 1E-5, data = training.map(_._1))\n    val clusters = kmeansImpl()\n    val radialBasisFunctions = clusters.map { case (means, cluster) =&gt; GaussianFunction(width = cluster.map(it =&gt; kmeansImpl(it, means)).max, center = means) }\n    val net = new RadialBasisFunctionNetwork(nIn = 1,rbfs = radialBasisFunctions,nOut = 1)\n    for (i &lt;- 0 to 500)\n      net.fit(training,0.1)\n    net\n}\nval models = \n    (for{i &lt;- 1 to 10} yield { \n        ( i -&gt; trainAndGetModel(rbfCount=i,trainingData))\n    })<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3>Visualization<\/h3>\n<p>Above, we trained 10 different models with 500 iterations with different hidden layer sizes (Gaussian unit counts) ranging from 1 to 10. We could have had different results by changing\u00a0<code>learningRate<\/code><span id=\"_tmp_pre_8\">;<\/span>\u00a0in this case, it is 0.1 since it gave us the minimum RMSE error. Let&#8217;s look at these 10 models RMSE results on both the training dataset and the test dataset. Let&#8217;s look at RMSE on both training and test set respectively.<\/p>\n<p><img decoding=\"async\" class=\"fr-fin fr-dib\" src=\"https:\/\/dzone.com\/storage\/temp\/5136202-trainingrmse.png\" alt=\"Image title\" width=\"826\" \/><\/p>\n<p>As is expected, the training RMSE is decreasing consistently as the Gaussian unit count increases. However, we need to look at test errors for choosing the right model.<\/p>\n<p><img decoding=\"async\" class=\"fr-fin fr-dib\" src=\"https:\/\/dzone.com\/storage\/temp\/5136211-testrmse.png\" alt=\"Image title\" width=\"830\" \/><\/p>\n<p>By analyzing RMSE errors on the graph, we can conclude that when RBF count is 1, it is seen that the error is high for both training and test data. So, this is an example of an underfit model. When RBF count is 3, the error drops significantly to the minimum on the test data. So, we can pick this model as a good fit model. However, when RBF count is higher than 3, the error gets higher on the test data. So, this is a sign that the model is overfitting, as the model gets more complex with more RBF units. Thus, a model with 10 RBF units is an example of overfitting model.<\/p>\n<p>Let&#8217;s pick those models and see their predictions in conjunction with actual data and RBF outputs.<\/p>\n<p><img decoding=\"async\" class=\"fr-fin fr-dib\" src=\"https:\/\/dzone.com\/storage\/temp\/5136271-underfit.png\" alt=\"Image title\" width=\"829\" \/><\/p>\n<p><img decoding=\"async\" class=\"fr-fin fr-dib\" src=\"https:\/\/dzone.com\/storage\/temp\/5136280-overfit.png\" alt=\"Image title\" width=\"829\" \/><\/p>\n<p><img decoding=\"async\" class=\"fr-fin fr-dib\" src=\"https:\/\/dzone.com\/storage\/temp\/5136295-goodfit.png\" alt=\"Image title\" width=\"829\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>In the above graphs, we merged training and test data and plot model predictions, RBF outputs, and actual data. As it is clearly seen, the underfitting model produces an output close to random that goes around zero \u2014 it doesn&#8217;t even model the training data. The overfitting model is more responsive to the noise on the training data; however, it doesn&#8217;t generalize well. However, the good-fitting model is well on both training and test data. You can experiment this by yourself using this <a href=\"https:\/\/github.com\/SercanKaraoglu\/rbf-nn\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">GitHub repo <\/a>and enjoy.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, I am going to demonstrate a two-step Scala implementation of Radial Basis Function Neural Network (RBFNetwork): (unsupervised) k-means clustering first, and (supervised) gradient descent second. This two-step implementation is fast and efficient compared to Multilayer Perceptron while providing good predictive performance. This is because unsupervised learning at the first step provides information [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":369,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[],"class_list":["post-296","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-al"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Scala Implementation of Radial Basis Function Neural Network<\/title>\n<meta name=\"description\" content=\"Learn more about two-step Scala implementation of Radial Basis Function Neural Network (RBFNetwork).\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Scala Implementation of Radial Basis Function Neural Network\" \/>\n<meta property=\"og:description\" content=\"Learn more about two-step Scala implementation of Radial Basis Function Neural Network (RBFNetwork).\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/\" \/>\n<meta property=\"og:site_name\" content=\"FinTech Trends, Emerging Technologies, News | ForInvest\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/forinvestcompany\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-27T14:35:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-02T13:00:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/artificial-intelligence.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2500\" \/>\n\t<meta property=\"og:image:height\" content=\"1500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sercan Karao\u011flu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ForInvestCom\" \/>\n<meta name=\"twitter:site\" content=\"@ForInvestCom\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sercan Karao\u011flu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/\"},\"author\":{\"name\":\"Sercan Karao\u011flu\",\"@id\":\"https:\/\/www.forinvest.com\/insights\/#\/schema\/person\/118a5cc3d3380b8b0ebe19ff8f7166dd\"},\"headline\":\"Radial Basis Function Neural Network Scala Implementation\",\"datePublished\":\"2017-04-27T14:35:47+00:00\",\"dateModified\":\"2024-07-02T13:00:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/\"},\"wordCount\":1025,\"publisher\":{\"@id\":\"https:\/\/www.forinvest.com\/insights\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/artificial-intelligence.jpg\",\"articleSection\":[\"AI\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/\",\"url\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/\",\"name\":\"Scala Implementation of Radial Basis Function Neural Network\",\"isPartOf\":{\"@id\":\"https:\/\/www.forinvest.com\/insights\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/artificial-intelligence.jpg\",\"datePublished\":\"2017-04-27T14:35:47+00:00\",\"dateModified\":\"2024-07-02T13:00:58+00:00\",\"description\":\"Learn more about two-step Scala implementation of Radial Basis Function Neural Network (RBFNetwork).\",\"breadcrumb\":{\"@id\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#primaryimage\",\"url\":\"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/artificial-intelligence.jpg\",\"contentUrl\":\"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/artificial-intelligence.jpg\",\"width\":2500,\"height\":1500},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.forinvest.com\/insights\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Radial Basis Function Neural Network Scala Implementation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.forinvest.com\/insights\/#website\",\"url\":\"https:\/\/www.forinvest.com\/insights\/\",\"name\":\"ForInvest\",\"description\":\"Insights\",\"publisher\":{\"@id\":\"https:\/\/www.forinvest.com\/insights\/#organization\"},\"alternateName\":\"ForInvest Yaz\u0131l\u0131m ve Teknoloji Hizmetleri A.\u015e.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.forinvest.com\/insights\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.forinvest.com\/insights\/#organization\",\"name\":\"ForInvest Yaz\u0131l\u0131m ve Teknoloji Hizmetleri A.\u015e.\",\"alternateName\":\"ForInvest\",\"url\":\"https:\/\/www.forinvest.com\/insights\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.forinvest.com\/insights\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2023\/11\/symbol.png\",\"contentUrl\":\"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2023\/11\/symbol.png\",\"width\":152,\"height\":152,\"caption\":\"ForInvest Yaz\u0131l\u0131m ve Teknoloji Hizmetleri A.\u015e.\"},\"image\":{\"@id\":\"https:\/\/www.forinvest.com\/insights\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/forinvestcompany\",\"https:\/\/x.com\/ForInvestCom\",\"https:\/\/www.instagram.com\/forinvest.app\/\",\"https:\/\/www.linkedin.com\/company\/forinvestcompany\/mycompany\/verification\/\",\"https:\/\/www.youtube.com\/@forinvestapp\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.forinvest.com\/insights\/#\/schema\/person\/118a5cc3d3380b8b0ebe19ff8f7166dd\",\"name\":\"Sercan Karao\u011flu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/9c78a5341b29975368781ff2b1ff82ad1414f72eeba69c9b3373a1fc0ff76fa7?s=96&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9c78a5341b29975368781ff2b1ff82ad1414f72eeba69c9b3373a1fc0ff76fa7?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9c78a5341b29975368781ff2b1ff82ad1414f72eeba69c9b3373a1fc0ff76fa7?s=96&r=g\",\"caption\":\"Sercan Karao\u011flu\"},\"sameAs\":[\"http:\/\/foreksdigital.com\"],\"url\":\"https:\/\/www.forinvest.com\/insights\/author\/sercankaraoglu\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Scala Implementation of Radial Basis Function Neural Network","description":"Learn more about two-step Scala implementation of Radial Basis Function Neural Network (RBFNetwork).","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"Scala Implementation of Radial Basis Function Neural Network","og_description":"Learn more about two-step Scala implementation of Radial Basis Function Neural Network (RBFNetwork).","og_url":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/","og_site_name":"FinTech Trends, Emerging Technologies, News | ForInvest","article_publisher":"https:\/\/www.facebook.com\/forinvestcompany","article_published_time":"2017-04-27T14:35:47+00:00","article_modified_time":"2024-07-02T13:00:58+00:00","og_image":[{"width":2500,"height":1500,"url":"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/artificial-intelligence.jpg","type":"image\/jpeg"}],"author":"Sercan Karao\u011flu","twitter_card":"summary_large_image","twitter_creator":"@ForInvestCom","twitter_site":"@ForInvestCom","twitter_misc":{"Written by":"Sercan Karao\u011flu","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#article","isPartOf":{"@id":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/"},"author":{"name":"Sercan Karao\u011flu","@id":"https:\/\/www.forinvest.com\/insights\/#\/schema\/person\/118a5cc3d3380b8b0ebe19ff8f7166dd"},"headline":"Radial Basis Function Neural Network Scala Implementation","datePublished":"2017-04-27T14:35:47+00:00","dateModified":"2024-07-02T13:00:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/"},"wordCount":1025,"publisher":{"@id":"https:\/\/www.forinvest.com\/insights\/#organization"},"image":{"@id":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/artificial-intelligence.jpg","articleSection":["AI"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/","url":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/","name":"Scala Implementation of Radial Basis Function Neural Network","isPartOf":{"@id":"https:\/\/www.forinvest.com\/insights\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#primaryimage"},"image":{"@id":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/artificial-intelligence.jpg","datePublished":"2017-04-27T14:35:47+00:00","dateModified":"2024-07-02T13:00:58+00:00","description":"Learn more about two-step Scala implementation of Radial Basis Function Neural Network (RBFNetwork).","breadcrumb":{"@id":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#primaryimage","url":"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/artificial-intelligence.jpg","contentUrl":"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2017\/04\/artificial-intelligence.jpg","width":2500,"height":1500},{"@type":"BreadcrumbList","@id":"https:\/\/www.forinvest.com\/insights\/2017\/04\/27\/radial-basis-function-neural-network-scala-implementation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.forinvest.com\/insights\/"},{"@type":"ListItem","position":2,"name":"Radial Basis Function Neural Network Scala Implementation"}]},{"@type":"WebSite","@id":"https:\/\/www.forinvest.com\/insights\/#website","url":"https:\/\/www.forinvest.com\/insights\/","name":"ForInvest","description":"Insights","publisher":{"@id":"https:\/\/www.forinvest.com\/insights\/#organization"},"alternateName":"ForInvest Yaz\u0131l\u0131m ve Teknoloji Hizmetleri A.\u015e.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.forinvest.com\/insights\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.forinvest.com\/insights\/#organization","name":"ForInvest Yaz\u0131l\u0131m ve Teknoloji Hizmetleri A.\u015e.","alternateName":"ForInvest","url":"https:\/\/www.forinvest.com\/insights\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.forinvest.com\/insights\/#\/schema\/logo\/image\/","url":"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2023\/11\/symbol.png","contentUrl":"https:\/\/www.forinvest.com\/insights\/wp-content\/uploads\/2023\/11\/symbol.png","width":152,"height":152,"caption":"ForInvest Yaz\u0131l\u0131m ve Teknoloji Hizmetleri A.\u015e."},"image":{"@id":"https:\/\/www.forinvest.com\/insights\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/forinvestcompany","https:\/\/x.com\/ForInvestCom","https:\/\/www.instagram.com\/forinvest.app\/","https:\/\/www.linkedin.com\/company\/forinvestcompany\/mycompany\/verification\/","https:\/\/www.youtube.com\/@forinvestapp"]},{"@type":"Person","@id":"https:\/\/www.forinvest.com\/insights\/#\/schema\/person\/118a5cc3d3380b8b0ebe19ff8f7166dd","name":"Sercan Karao\u011flu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9c78a5341b29975368781ff2b1ff82ad1414f72eeba69c9b3373a1fc0ff76fa7?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9c78a5341b29975368781ff2b1ff82ad1414f72eeba69c9b3373a1fc0ff76fa7?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9c78a5341b29975368781ff2b1ff82ad1414f72eeba69c9b3373a1fc0ff76fa7?s=96&r=g","caption":"Sercan Karao\u011flu"},"sameAs":["http:\/\/foreksdigital.com"],"url":"https:\/\/www.forinvest.com\/insights\/author\/sercankaraoglu\/"}]}},"_links":{"self":[{"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/posts\/296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/comments?post=296"}],"version-history":[{"count":3,"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/posts\/296\/revisions"}],"predecessor-version":[{"id":1230,"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/posts\/296\/revisions\/1230"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/media\/369"}],"wp:attachment":[{"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/media?parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/categories?post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.forinvest.com\/insights\/wp-json\/wp\/v2\/tags?post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}