Questions tagged [pruning]

Use pruning for questions related to algorithms used on data structures to facilitate generalization and performance optimization.

Pruning is a general technique to guard against the creation of an algorithm too specific to the training data so that it can be applied to other data sets.

References

193 questions
1
vote
1 answer

R: Pruning data.tree without altering

In the data.tree package when one prunes a tree, it permanently alters the tree. This is problematic, as my data.tree takes a long time to generate, and I don't want to generate a new one everytime I have to do a new pruning. Here I generate a…
Esben Eickhardt
  • 3,183
  • 2
  • 35
  • 56
1
vote
3 answers

Scala Match Case structure and traversing a List with odd terms cs and m?

I am trying to understand this piece of code here def countChange(money: Int, coins: List[Int]): Int = (money, coins) match { case (0, _) => 1 case (m, _) if m < 0 => 0 case (_, cs) if cs.isEmpty => 0 case (m, cs) =>…
hhh
  • 50,788
  • 62
  • 179
  • 282
1
vote
1 answer

Undelete specific empty commits after rewriting history with prune-empty

I rewrote git history with filter-branch & --prune-empty. Now I need to recover some commits with specific message. Can I do that? I don't run git reflog or git gc
Aleksandr Vishnyakov
  • 1,872
  • 5
  • 23
  • 39
1
vote
5 answers

How do I prune all the '' from these strings generated from a CSV?

I've made this formula which turns a CSV into a dictionary: def CSVtoDict(BDF, mode): saved={} with open('%s%s.csv' % (dataDir,BDF), mode='r') as infile: reader = csv.reader(infile) for row in reader: if mode is…
1
vote
4 answers

Efficient way to prune HashMap

I am creating a Flyweight in Java, and I want to make sure I don't create too large a map. Is there a more efficient way to prune the map? I did not see any properties that could do this automatically (like a max size constructor), so I am doing…
Nix
  • 57,072
  • 29
  • 149
  • 198
1
vote
1 answer

How to applied alpha-beta pruning in implementing 2048 AI agent with minimax algorithm?

I'm developing an AI for 2048, and am about to apply minimax algorithm. However, the search tree of 2048 is actually like a Expectiminimax tree without Min role. I wonder if I don't have Min role, how could I apply alpha-beta pruning in practice? If…
1
vote
3 answers

Fibonacci sequence pruning using java

Here is my implementation of the fibonacci sequence using java /** * Returns nth fibonacci number */ public class fib { public static void main(String[] args){ System.out.println(fibonacci(12)); } public static int fibonacci(int…
1
vote
1 answer

Reduced Error Pruning Algorithm

I have a question about this algorithm: Partition training data in “grow” and “validation” sets. Build a complete tree from the “grow” data. Until accuracy on validation set decreases do: For each non-leaf node, n, in the tree do: …
Nick
  • 2,818
  • 5
  • 42
  • 60
1
vote
1 answer

Counting the number of specific elements in a pruned dendrogram leaf

I am doing a cluster analysis and I want to count the number of occurences of a certain variable in a leaf of a pruned tree. Below is a simplified example where the pruned tree has only three branches. I now want to know the number of As and Bs in…
horseshoe
  • 1,437
  • 14
  • 42
1
vote
1 answer

Do I have to drop the primary key or reload the table data for partitioning in MySQL InnoDB?

I have to partition a few tables by date range. Do I have to drop the primary or reload the complete data to be able to partition these tables? Some of the tables do contain a lot more than 50 million rows. alter table temp_table_test1 partition by…
1
vote
1 answer

oracle force partition pruning with in condition

I have a table with list partitions on two columns in order of MY_ID (integer with values 1,2,3,5,8...1100), RUN_DATE (past some days). My query is select * from my_partitioned_table where run_date = '10-sep-2014' and my_id in (select my_id from…
androboy
  • 817
  • 1
  • 12
  • 24
1
vote
1 answer

Python Dictionary - Consolidating Leaf Nodes below a threshold

Below is a simplified example of a decision tree (dict()) that I trained in Python: tree= {'Age': {'> 55': 0.4, '< 18': {'Income': {'high': 0, 'low': 0.2}}, '18-35': 0.25, '36-55': {'Marital_Status': {'single': {'Income': …
Zhubarb
  • 11,432
  • 18
  • 75
  • 114
1
vote
0 answers

Java Decision Tree -- Reduced Error Pruning Validation Set

Are there any free Java libraries available for training decision trees that allow for the setting of a separate validation set for reduced error pruning? For Weka (what I'm currently using), it only allows for n-fold cross validation using a random…
lrAndroid
  • 2,834
  • 18
  • 27
0
votes
0 answers

Neural Network Pruning in PyTorch - from scratch

I am trying to implement global, unstructured pruning algorithm closely based on The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks, Frankle et al. and Comparing Rewinding and Fine-tuning in Neural Network Pruning, Renda et al.…
Arun
  • 2,222
  • 7
  • 43
  • 78
0
votes
0 answers

Pytorch pruning channels of trained ResNet model while preserving the unpruned channels’ weight?

I want to ask whether there is a method to prune channels of trained ResNet model while preserving the unpruned channels’ weight? The pruning method I used is similar to "Pruning from Scratch" paper, but I want to use my trained ResNet-50 instead of…