def test_one_with_one_without_parameters(population_strategy:
PopulationStrategy):
n = 10
kernels = []
df_without = pd.DataFrame(index=list(range(n)))
w_without = sp.ones(n) / n
kernel_without = MultivariateNormalTransition()
kernel_without.fit(df_without, w_without)
kernels.append(kernel_without)
df_with = pd.DataFrame([{"s": sp.rand()} for _ in range(n)])
w_with = sp.ones(n) / n
kernel_with = MultivariateNormalTransition()
kernel_with.fit(df_with, w_with)
kernels.append(kernel_with)
population_strategy.adapt_population_size(kernels, sp.array([.7, .3]))
assert population_strategy.nr_particles > 0
评论列表
文章目录