我想使用高斯混合模型来返回如下图所示的内容,除了正确的高斯分布。
我正在尝试使用 pythonsklearn.mixture.GaussianMixture但我失败了。我可以将每个峰值视为任何给定 x 值的直方图的高度。我的问题是:我是否必须找到一种方法将这个图转换为直方图并删除负值,或者有没有办法将 GMM 直接应用于这个数组以产生红色和绿色高斯?
我正在 jupyter notebook 中运行神经网络算法。
input_func = tf.estimator.inputs.pandas_input_fn(
x=X_train,
y=y_train,
batch_size=10,
num_epochs=5,
shuffle=True)
Run Code Online (Sandbox Code Playgroud)
产生这个错误:
AttributeError: 模块“tensorflow_core.estimator”没有属性“inputs”
我不明白为什么会这样。我尝试卸载并重新安装 tensorflow。
有谁知道如何解决这一问题?
在ghci模式下,我可以输入以下行:
map read $ words "1 2 3 4 5" :: [Int]
Run Code Online (Sandbox Code Playgroud)
得到[1,2,3,4,5]
当我创建一个名为splitscan.hs的文件,其中包含以下行:
map read $ words scan :: [Float]
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
[1/1]编译Main(splitscan.hs,splitscan.o)
splitscan.hs:1:1: error:
Invalid type signature: map read $ words str :: ...
Should be of form <variable> :: <type>
|
1 | map read $ words str :: [Float]
| ^^^^^^^^^^^^^^^^^^^^
Run Code Online (Sandbox Code Playgroud)
当我这样做:
import System.IO
main = do
scan <- readFile "g924310_b1_copy.txt"
map read $ words scan :: [Float]
putStr scan
Run Code Online (Sandbox Code Playgroud)
我明白了:
readscan.hs:5:5: error:
• Couldn't match type …Run Code Online (Sandbox Code Playgroud)