ML
Similarities | Java | Python |
---|---|---|
Load CSV | Table.read().csv() |
pd.read_csv() |
Fill missing | setMissingTo(median) |
fillna(median) |
Drop columns | removeColumns(...) |
drop(columns=...) |
Encode categories | replaceAll(...) |
map({...}) |
Normalize | normalize() |
(val - min) / (max - min) |
Convert to model input | Instances , DenseInstance(...) |
DataFrame → array → model |
Train model | J48 , Logistic , CV |
DecisionTree , LogReg , CV |
public void addNode() {
adjacencyList.add(new LinkedList<>());
nodes++;
System.out.println("Node " + (nodes - 1) + " added.");
}
public void removeEdge(int source, int destination) {
if (source < nodes && destination < nodes) {
if (adjacencyList.get(source).remove(Integer.valueOf(destination))) {
System.out.println("Edge from " + source + " to " + destination + " removed.");
} else {
System.out.println("Edge from " + source + " to " + destination + " does not exist.");
}
} else {
System.out.println("Invalid node index.");
}
}