使用pandas crosstab和pandas_ml ConfusionMatrix创建混淆矩阵时遇到问题

时间:2019-12-24 18:01:04

标签: python pandas sklearn-pandas

对于顺序模型,尝试将“实际”值与“预测”值进行比较。 “实际”值包含在数据框中,而“预测”值是由model.predict函数生成的数组。我遇到很多不匹配的情况,并且遇到了各种错误,包括“数据必须为一维”,“ ValueError:传递的项目数错误1,放置位置暗示1406”等。
我尝试了pd.values,pd.values.tolist()的各种组合,试图制作数据帧的数组,等等。

var path = require('path');
var HtmlWebpackPlugin =  require('html-webpack-plugin');

module.exports = {
    entry : './app/index.js',
    output : {
        path : path.resolve(__dirname , 'dist'),
        filename: 'index_bundle.js',
        publicPath: '/'
    },
    module : {
        rules : [
            {test : /\.(js|jsx)$/, use:'babel-loader'},
            {test : /\.css$/, use:['style-loader', 'css-loader']},
            {test: /\.(png|jpe?g|gif)$/i, use: ['file-loader' ]},
            {test: /\.(woff|woff2|eot|ttf|otf)$/, use: ['file-loader']},
            {test: /\.(png|jpg|gif)$/i, use: ['url-loader']},
        ]
    },
    // this and publicPath: '/' is needed when refreshing same url.
    // index.html page will likely have to be served in place of any 404 responses.

    devServer: {
        historyApiFallback: true,
    },
    mode:'development',
    plugins : [
        new HtmlWebpackPlugin ({
            template : './app/index.html'
        })
    ]

};

感谢帮助!

0 个答案:

没有答案