This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.util.Random | |
/** | |
* @author mandar2812 | |
*/ | |
object MedianRecursive { | |
def median(list: Stream[Double]): Double = { | |
val random: (Int) => Int = Random.nextInt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Hermite { | |
def hermite(n: Int, x: Double): Double = { | |
def hermiteHelper(k: Int, x: Double, a: Double, b: Double): Double = | |
k match { | |
case 0 => a | |
case 1 => b | |
case _ => hermiteHelper(k-1, x, b, x*b - (k-1)*a) | |
} | |
hermiteHelper(n, x, 1, x) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import breeze.linalg.DenseVector | |
object Stats { | |
/** | |
* Get the mean and variance of a data set | |
* which is a [[List]] of [[DenseVector]]. | |
* | |
* @param data The data set. | |
* | |
* @return A [[Tuple2]] containing the mean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import breeze.linalg.DenseVector | |
import io.github.mandar2812.dynaml.DynaMLPipe._ | |
import io.github.mandar2812.dynaml.evaluation.RegressionMetrics | |
import io.github.mandar2812.dynaml.kernels._ | |
import io.github.mandar2812.dynaml.modelpipe.GPRegressionPipe | |
import io.github.mandar2812.dynaml.models.gp.AbstractGPRegressionModel | |
import io.github.mandar2812.dynaml.pipes.{BifurcationPipe, DataPipe, StreamDataPipe} | |
import io.github.mandar2812.dynaml.utils.GaussianScaler | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import breeze.linalg.{DenseMatrix, DenseVector} | |
import com.quantifind.charts.Highcharts._ | |
import io.github.mandar2812.dynaml.evaluation.RegressionMetrics | |
import io.github.mandar2812.dynaml.kernels.{CovarianceFunction, LocalSVMKernel} | |
import io.github.mandar2812.dynaml.models.svm.DLSSVM | |
import io.github.mandar2812.dynaml.optimization.{GPMLOptimizer, GridSearch} | |
import io.github.mandar2812.dynaml.pipes.{StreamDataPipe, DynaMLPipe, DataPipe} | |
import org.apache.log4j.Logger | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import breeze.linalg.{DenseMatrix, DenseVector} | |
import com.quantifind.charts.Highcharts._ | |
import io.github.mandar2812.dynaml.evaluation.RegressionMetrics | |
import io.github.mandar2812.dynaml.kernels.CovarianceFunction | |
import io.github.mandar2812.dynaml.models.gp.GPNarModel | |
import io.github.mandar2812.dynaml.optimization.{GPMLOptimizer, GridSearch} | |
import io.github.mandar2812.dynaml.pipes.{DynaMLPipe, DataPipe} | |
import org.apache.log4j.Logger | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import breeze.linalg.{DenseMatrix, DenseVector} | |
import com.quantifind.charts.Highcharts._ | |
import io.github.mandar2812.dynaml.evaluation.RegressionMetrics | |
import io.github.mandar2812.dynaml.kernels.CovarianceFunction | |
import io.github.mandar2812.dynaml.models.gp.GPNarXModel | |
import io.github.mandar2812.dynaml.optimization.{GPMLOptimizer, GridSearch} | |
import io.github.mandar2812.dynaml.pipes.{StreamDataPipe, DynaMLPipe, DataPipe} | |
import org.apache.log4j.Logger | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import breeze.linalg.{DenseMatrix, DenseVector} | |
import io.github.mandar2812.dynaml.evaluation.RegressionMetrics | |
import io.github.mandar2812.dynaml.kernels._ | |
import io.github.mandar2812.dynaml.models.gp.GPRegression | |
import io.github.mandar2812.dynaml.models.neuralnets.{FeedForwardNetwork, FFNeuralGraph} | |
import io.github.mandar2812.dynaml.pipes.{StreamDataPipe, DataPipe} | |
import io.github.mandar2812.dynaml.utils | |
/** | |
* Created by mandar on 11/1/16. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import breeze.linalg.DenseVector | |
import io.github.mandar2812.dynaml.evaluation.BinaryClassificationMetrics | |
import io.github.mandar2812.dynaml.models.neuralnets.{FFNeuralGraph, FeedForwardNetwork} | |
import io.github.mandar2812.dynaml.pipes.{DataPipe, DynaMLPipe, StreamDataPipe} | |
/** | |
* Created by mandar on 11/1/16. | |
*/ | |
object TestNNWineQuality { | |
def apply (hidden: Int = 2, nCounts:List[Int] = List(), acts:List[String], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import breeze.linalg.DenseVector | |
import io.github.mandar2812.dynaml.evaluation.BinaryClassificationMetrics | |
import io.github.mandar2812.dynaml.models.lm.LogisticGLM | |
import io.github.mandar2812.dynaml.pipes.{DataPipe, DynaMLPipe, StreamDataPipe} | |
object TestLogisticWineQuality { | |
def apply(training: Int = 100, test: Int = 1000, | |
columns: List[Int] = List(11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), | |
stepSize: Double = 0.01, maxIt: Int = 30, mini: Double = 1.0, | |
regularization: Double = 0.5, wineType: String = "red", |