解法: 字典统计排序
class Solution:def topKFrequent(self, nums: List[int], k: int) -> List[int]:cont {}for eve in nums:if eve not in cont: cont[eve] 1else: cont[eve] 1contlist sorted(cont.items(), keylambda x: x[1])res [eve[0] for eve i…
目录
一、决策树剪枝
1、什么是决策树剪枝?
2、如何剪枝
3、剪枝剪哪个位置的叶子结点
二、树模型参数及用法
1、参数种类
2、参数解释
1)criterion:gini or entropy
2)splitter:best or random
3࿰…