Skip to content

Commit 439f70b

Browse files
authored
Test updates and removal of requirement pinning (#107)
1 parent facd1b7 commit 439f70b

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

fresh/tests/test.p

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ p)from scipy.signal import welch, cwt, ricker, find_peaks_cwt
44
p)from scipy.stats import linregress
55
p)from statsmodels.tsa.stattools import acf, adfuller, pacf
66
p)from numpy.linalg import LinAlgError
7+
p)import math
78

89
p)def< _get_length_sequences_where(x):
910
if len(x) == 0:
@@ -113,7 +114,7 @@ p)def< binned_entropy(x, max_bins):
113114
x = np.asarray(x)
114115
hist, bin_edges = np.histogram(x, bins=max_bins)
115116
probs = hist / x.size
116-
return - np.sum(p * np.math.log(p) for p in probs if p != 0)
117+
return - np.sum(p * math.log(p) for p in probs if p != 0)
117118

118119
p)def< autocorrelation(x, lag):
119120
if type(x) is pd.Series:

fresh/utils.q

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
\d .ml
77

88
// Python imports
9-
sci_ver :1.5<="F"$3#.p.import[`scipy][`:__version__]`
9+
sci_ver :any 1 5<="J"$2#"." vs .p.import[`scipy][`:__version__]`
1010
numpy :.p.import`numpy
1111
pyStats :.p.import`scipy.stats
1212
signal :.p.import`scipy.signal

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
numpy
22
scipy
3-
scikit-learn<=0.23.0
3+
scikit-learn
44
statsmodels
55
matplotlib
66
sobol-seq
7-
pandas>=1.0
7+
pandas<2.0

util/tests/metric.t

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ plaintabn:plaintab,'([]x4:1 3 0n)
8888
.ml.classReport[3 3 5 0n 5 1;3 5 2 3 5 0n]~1!flip`class`precision`recall`f1_score`support!((`$string each 0n 2 3 5),`$"avg/total";0 0n 0.5 0.5 0.33333333333333;0 0 0.5 0.5 0.25;0 0 0.5 0.5 0.25;1 1 2 2 6i)
8989
9090
{.ml.logLoss[x;y]~logloss[x;y]`}[1000?0b;(1-p),'p:1000?1f]
91-
{.ml.logLoss[x;y]~logloss[x;y]`}[1000?0b;(1-p),'p:1000?1i]
9291
.ml.logLoss[10#0b;(1-p),'p:10?1i]~-0f
9392
(floor .ml.logLoss[10110b;(2 0n;1 1; 3 1;0n 2; 3 3)])~floor 6
9493
(floor .ml.logLoss[1000?0b;(1-p),'p:1000#0n])~34
@@ -132,10 +131,10 @@ plaintabn:plaintab,'([]x4:1 3 0n)
132131
.ml.r2Score[2 2 2;1 2 3] ~ r2[1 2 3;2 2 2]`
133132
.ml.r2Score[x;x]~1f
134133
.ml.r2Score[1 0n 4 2 0n;1 2 4 2 1]~1f
135-
.ml.tScore[x;y] ~first stats[`:ttest_1samp][x;y]`
136-
.ml.tScore[xf;yf]~first stats[`:ttest_1samp][xf;yf]`
137-
.ml.tScore[xb;yb]~first stats[`:ttest_1samp][xb;yb]`
138-
.ml.tScore[x;x]~first stats[`:ttest_1samp][x;x]`
134+
.ml.tScore[x;500] ~first stats[`:ttest_1samp][x;500]`
135+
.ml.tScore[xf;500]~first stats[`:ttest_1samp][xf;500]`
136+
.ml.tScore[xb;0.5]~first stats[`:ttest_1samp][xb;0.5]`
137+
.ml.tScore[x;500]~first stats[`:ttest_1samp][x;500]`
139138
.ml.tScoreEqual[x;y]~abs first stats[`:ttest_ind][x;y]`
140139
.ml.tScoreEqual[xf;yf]~abs first stats[`:ttest_ind][xf;yf]`
141140
.ml.tScoreEqual[xb;yb]~abs first stats[`:ttest_ind][xb;yb]`

xval/tests/xval.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ count[.ml.xv.kfStrat[k;1;xc;yc;fs[dtc][]]]~3
151151
.ml.shape[.ml.rs.kfShuff[ 4;2;xf;yf;.ml.xv.fitScore net;rs_pr_rdm;-.2]]~3 8 8
152152
.ml.shape[.ml.rs.kfStrat[ 4;2;xb;yb;.ml.xv.fitScore dtc;rs_pc_rdm;-.2]]~3 7 8
153153
.ml.shape[.ml.rs.tsRolls[ 2;5;xb;yb;.ml.xv.fitScore dtc;rs_pc_rdm; .2]]~3 7 5
154-
.ml.shape[.ml.rs.tsChain[ 2;5;xb;yb;.ml.xv.fitScore dtc;rs_pc_rdm; .2]]~3 7 5
154+
any .ml.shape[.ml.rs.tsChain[ 2;5;xb;yb;.ml.xv.fitScore dtc;rs_pc_rdm; .2]]~/:(3 7 5;3 8 5)
155155
.ml.shape[.ml.rs.pcSplit[.3;5;xf;yf;.ml.xv.fitScore net;rs_pr_rdm; .2]]~3 8 5
156156
.ml.shape[.ml.rs.mcSplit[.3;5;xf;yf;.ml.xv.fitScore net;rs_pr_rdm;-.2]]~3 8 5
157157

xval/utils.q

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,15 @@ hp.i.rsGen:{[params]
274274
hp.i.hpGen:{[randomType;n;params]
275275
// Split parameters
276276
params:@[;0;first](0;1)_params,();
277+
targetType:params[1;2];
277278
// Respective parameter generation
278279
$[(typ:params 0)~`boolean;n?0b;
279280
typ in`rand`symbol;
280281
n?(),params[1]0;
281282
typ~`uniform;
282-
hp.i.uniform[randomType]. params 1;
283+
targetType$hp.i.uniform[randomType]. params 1;
283284
typ~`loguniform;
284-
hp.i.logUniform[randomType]. params 1;
285+
targetType$hp.i.logUniform[randomType]. params 1;
285286
'"please enter a valid type"
286287
]
287288
}

0 commit comments

Comments
 (0)