Fixed select minor warnings
This commit is contained in:
parent
a324f8a7d6
commit
96f0ab150d
|
@ -1,6 +1,3 @@
|
|||
open Jest
|
||||
open Expect
|
||||
|
||||
// let PointSetDist: PointSetTypes.xyPointSetDist = {xs: [1., 4., 8.], ys: [8., 9., 2.]}
|
||||
|
||||
// let makeTest = (~only=false, str, item1, item2) =>
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
open Jest
|
||||
open Expect
|
||||
/*
|
||||
let makeTest = (~only=false, str, item1, item2) =>
|
||||
only
|
||||
|
|
|
@ -38,7 +38,7 @@ describe("Lodash", () =>
|
|||
let toArr = discrete |> E.FloatFloatMap.toArray
|
||||
makeTest("splitMedium", toArr |> Belt.Array.length, 10)
|
||||
|
||||
let (c, discrete) = SampleSet.Internals.T.splitContinuousAndDiscrete(
|
||||
let (_c, discrete) = SampleSet.Internals.T.splitContinuousAndDiscrete(
|
||||
makeDuplicatedArray(500),
|
||||
)
|
||||
let toArr = discrete |> E.FloatFloatMap.toArray
|
||||
|
|
|
@ -153,31 +153,6 @@ module Function = {
|
|||
}
|
||||
}
|
||||
|
||||
module Primative = {
|
||||
type t = [
|
||||
| #SymbolicDist(SymbolicDistTypes.symbolicDist)
|
||||
| #RenderedDist(PointSetTypes.pointSetDist)
|
||||
| #Function(array<string>, node)
|
||||
]
|
||||
|
||||
let isPrimative: node => bool = x =>
|
||||
switch x {
|
||||
| #SymbolicDist(_)
|
||||
| #RenderedDist(_)
|
||||
| #Function(_) => true
|
||||
| _ => false
|
||||
}
|
||||
|
||||
let fromNode: node => option<t> = x =>
|
||||
switch x {
|
||||
| #SymbolicDist(_) as n
|
||||
| #RenderedDist(_) as n
|
||||
| #Function(_) as n =>
|
||||
Some(n)
|
||||
| _ => None
|
||||
}
|
||||
}
|
||||
|
||||
module SamplingDistribution = {
|
||||
type t = [
|
||||
| #SymbolicDist(SymbolicDistTypes.symbolicDist)
|
||||
|
|
|
@ -100,8 +100,6 @@ let combineShapesContinuousContinuous = (
|
|||
s1: PointSetTypes.xyShape,
|
||||
s2: PointSetTypes.xyShape,
|
||||
): PointSetTypes.xyShape => {
|
||||
let t1n = s1 |> XYShape.T.length
|
||||
let t2n = s2 |> XYShape.T.length
|
||||
|
||||
// if we add the two distributions, we should probably use normal filters.
|
||||
// if we multiply the two distributions, we should probably use lognormal filters.
|
||||
|
@ -194,7 +192,7 @@ let toDiscretePointMassesFromDiscrete = (s: PointSetTypes.xyShape): pointMassesW
|
|||
|
||||
let masses: array<float> = Belt.Array.makeBy(n, i => ys[i])
|
||||
let means: array<float> = Belt.Array.makeBy(n, i => xs[i])
|
||||
let variances: array<float> = Belt.Array.makeBy(n, i => 0.0)
|
||||
let variances: array<float> = Belt.Array.makeBy(n, _ => 0.0)
|
||||
|
||||
{n: n, masses: masses, means: means, variances: variances}
|
||||
}
|
||||
|
|
|
@ -240,9 +240,6 @@ let combineAlgebraically = (op: Operation.algebraicOperation, t1: t, t2: t): t =
|
|||
// sqtl > 10 ? T.downsample(int_of_float(sqtl), t) : t;
|
||||
//};
|
||||
|
||||
let t1d = t1
|
||||
let t2d = t2
|
||||
|
||||
// continuous (*) continuous => continuous, but also
|
||||
// discrete (*) continuous => continuous (and vice versa). We have to take care of all combos and then combine them:
|
||||
let ccConvResult = Continuous.combineAlgebraically(op, t1.continuous, t2.continuous)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
open Distributions
|
||||
|
||||
type t = PointSetTypes.pointSetDist
|
||||
|
||||
let mapToAll = ((fn1, fn2, fn3), t: t) =>
|
||||
switch t {
|
||||
| Mixed(m) => fn1(m)
|
||||
|
@ -77,9 +78,6 @@ module T = Dist({
|
|||
|
||||
let toPointSetDist = (t: t) => t
|
||||
|
||||
let toContinuous = t => None
|
||||
let toDiscrete = t => None
|
||||
|
||||
let downsample = (i, t) =>
|
||||
fmap((Mixed.T.downsample(i), Discrete.T.downsample(i), Continuous.T.downsample(i)), t)
|
||||
|
||||
|
@ -93,8 +91,6 @@ module T = Dist({
|
|||
t,
|
||||
)
|
||||
|
||||
let toDiscreteProbabilityMassFraction = t => 0.0
|
||||
|
||||
let normalize = fmap((Mixed.T.normalize, Discrete.T.normalize, Continuous.T.normalize))
|
||||
|
||||
let updateIntegralCache = (integralCache, t: t): t =>
|
||||
|
|
|
@ -159,7 +159,7 @@ module XtoY = {
|
|||
y1 *. (1. -. fraction) +. y2 *. fraction
|
||||
}
|
||||
| (#Stepwise, #UseZero) =>
|
||||
(t: T.t, leftIndex: int, x: float) =>
|
||||
(t: T.t, leftIndex: int, _x: float) =>
|
||||
if leftIndex < 0 {
|
||||
0.0
|
||||
} else if leftIndex >= T.length(t) - 1 {
|
||||
|
@ -168,7 +168,7 @@ module XtoY = {
|
|||
t.ys[leftIndex]
|
||||
}
|
||||
| (#Stepwise, #UseOutermostPoints) =>
|
||||
(t: T.t, leftIndex: int, x: float) =>
|
||||
(t: T.t, leftIndex: int, _x: float) =>
|
||||
if leftIndex < 0 {
|
||||
t.ys[0]
|
||||
} else if leftIndex >= T.length(t) - 1 {
|
||||
|
|
|
@ -97,7 +97,7 @@ module Scale = {
|
|||
|
||||
let toIntegralCacheFn = x =>
|
||||
switch x {
|
||||
| #Multiply => (a, b) => None // TODO: this could probably just be multiplied out (using Continuous.scaleBy)
|
||||
| #Multiply => (_, _) => None // TODO: this could probably just be multiplied out (using Continuous.scaleBy)
|
||||
| #Exponentiate => (_, _) => None
|
||||
| #Log => (_, _) => None
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user