apriori模型具有TypeError:不可排序的类型:float()<str()

时间:2018-12-07 14:34:24

标签: python-3.x machine-learning

mydataset 我正确导入了所有库,但无法获取规则列表,并显示以下“ TypeError:无法排序的类型:float()

static String XSL =
        "<xsl:stylesheet version=\"1.0\"\n" +
        "    xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n" +
        "    <xsl:template match=\"@*|node()\">\n" +
        "        <xsl:copy>\n" +
        "            <xsl:apply-templates select=\"@*|node()\" />\n" +
        "        </xsl:copy>\n" +
        "    </xsl:template>\n" +
        "\n" +
        "    <xsl:template match=\"test-method[@status = 'FAIL']\"/>\n" +
        "</xsl:stylesheet>";

static String XML =
        "<test-result>\n" +
        "    <test-method status=\"PASS\" name=\"beforeTestSetup\"\n" +
        "        is-config=\"true\" duration-ms=\"705\"\n" +
        "        started-at=\"2018-08-16T21:39:59Z\"\n" +
        "        finished-at=\"2018-08-16T21:39:59Z\">\n" +
        "        <params>\n" +
        "            <param index=\"0\">\n" +
        "                <value> <![CDATA[org.testng.TestRunner@31c2affc]]>\n" +
        "                </value>\n" +
        "            </param>\n" +
        "        </params>\n" +
        "    </test-method>\n" +
        "    <test-method status=\"FAIL\" name=\"beforeTestSetup\"\n" +
        "        is-config=\"true\" duration-ms=\"805\"\n" +
        "        started-at=\"2018-08-16T21:39:59Z\"\n" +
        "        finished-at=\"2018-08-16T21:39:59Z\">\n" +
        "        <params>\n" +
        "            <param index=\"0\">\n" +
        "                <value> <![CDATA[org.testng.TestRunner@31c2affc]]>\n" +
        "                </value>\n" +
        "            </param>\n" +
        "        </params>\n" +
        "    </test-method>\n" +
        "    <test-method status=\"PASS\" name=\"TEST\" is-config=\"true\"\n" +
        "        duration-ms=\"905\" started-at=\"2018-08-16T21:39:59Z\"\n" +
        "        finished-at=\"2018-08-16T21:39:59Z\">\n" +
        "        <params>\n" +
        "            <param index=\"0\">\n" +
        "                <value> <![CDATA[org.testng.TestRunner@31c2affc]]>\n" +
        "                </value>\n" +
        "            </param>\n" +
        "        </params>\n" +
        "    </test-method>\n" +
        "</test-result>";

public static void main(String[] args) throws Exception {
    Transformer t = TransformerFactory.
            newInstance()
            .newTransformer(new StreamSource(new StringReader(XSL)));

    t.transform(new StreamSource(new StringReader(XML)), new StreamResult(System.out));

}

我在执行最后一行时遇到此错误

0 个答案:

没有答案