Skip to content

Commit

Permalink
20220111 Search bars, GUI Scaling, KNN param fix
Browse files Browse the repository at this point in the history
Added "smart" search bars for each module type
Fixed frame and widget scaling when resizing the window
Fixed K nearest neighbor classifier's parameters for GUI/GLI
  • Loading branch information
Michaeljfang authored and DavidBerdik committed Jan 12, 2023
1 parent 0c1e66f commit 5b24924
Show file tree
Hide file tree
Showing 3 changed files with 531 additions and 157 deletions.
36 changes: 32 additions & 4 deletions src/com/jgaap/JGAAPConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.io.File;
import java.io.IOException;
import java.util.HashMap;

/**
* Defines a whole slew of public static constants that can be used system-wide.
Expand Down Expand Up @@ -80,7 +81,7 @@ private static String processPath(String path) {
}

public static final String JGAAP_RESOURCE_PACKAGE = "/com/jgaap/resources/";

/**
* Java Prefix for different types of object collections
*/
Expand All @@ -93,10 +94,37 @@ private static String processPath(String path) {
public static final String JGAAP_GENERICSPREFIX = "com.jgaap.generics.";
public static final String JGAAP_BACKENDPREFIX = "com.jgaap.backend.";
public static final String JGAAP_LANGUAGEPREFIX = "com.jgaap.languages.";

/**
* Version Information
*/
public static final String VERSION = "8.0.2";
public static final String YEAR = "2021";
public static final String VERSION = "8.0.3";
public static final String YEAR = "2022";

// search table
public static HashMap<String, String[]> JGAAP_SEARCH_TABLE
= new HashMap<String, String[]>();
static {
// if the search term contains the key, add its hash value to the search terms too.
// a key's values are added if the key **contains** the text in the search box.
// module is matched if its name contains any of the search terms.
JGAAP_SEARCH_TABLE.put("neural networks", new String[] {"perceptron", "nn"});
JGAAP_SEARCH_TABLE.put("neuro networks", new String[] {"perceptron", "nn"});
JGAAP_SEARCH_TABLE.put("mlp", new String[] {"multilayer perceptron"});
JGAAP_SEARCH_TABLE.put("ngrams", new String[] {"n gram", "n word gram", "n character gram", "ngram"});
JGAAP_SEARCH_TABLE.put("n grams", new String[] {"n word gram", "n character gram", "ngram", "n gram"});
JGAAP_SEARCH_TABLE.put("parts of speech", new String[] {"pos", "part of speech"});
JGAAP_SEARCH_TABLE.put("part of speech", new String[] {"pos", "parts of speech"});
JGAAP_SEARCH_TABLE.put("x", new String[] {"cross"});
JGAAP_SEARCH_TABLE.put("xentropy", new String[] {"cross entropy"});
JGAAP_SEARCH_TABLE.put("histogram distance", new String[] {"euclidean"});
JGAAP_SEARCH_TABLE.put("euclidean", new String[] {"histogram distance"});
JGAAP_SEARCH_TABLE.put("cosine similarity", new String[] {"cosine distance"});
JGAAP_SEARCH_TABLE.put("cosine distance", new String[] {"cosine similarity"});
JGAAP_SEARCH_TABLE.put("information radius", new String[] {"jensen shannon"});
JGAAP_SEARCH_TABLE.put("linear discriminant analysis", new String[] {"lda"});
JGAAP_SEARCH_TABLE.put("sequential minimal optimization", new String[] {"smo"});
JGAAP_SEARCH_TABLE.put("juola wyner", new String[] {"jw", "thin cross entropy"});
JGAAP_SEARCH_TABLE.put("iqr", new String[] {"interquartile range"});
JGAAP_SEARCH_TABLE.put("burrow's delta", new String[] {"burrows delta"});
}
}
4 changes: 4 additions & 0 deletions src/com/jgaap/classifiers/KNearestNeighborDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public class KNearestNeighborDriver extends NeighborAnalysisDriver {
private static final int DEFAULT_K = 5;
private static final String DEFAULT_TIE = "lastPicked";

public KNearestNeighborDriver() {
addParams("k", "K", "5", new String[] {"1","2","3","4","5","6","7","8","9","10"}, false);
}

public String displayName() {
return "K-Nearest Neighbor Driver" + getDistanceName();
}
Expand Down
Loading

0 comments on commit 5b24924

Please sign in to comment.