@astermind/astermind-premium
Version:
Astermind Premium - Premium ML Toolkit
70 lines • 1.71 kB
TypeScript
export interface GraphELMOptions {
categories: string[];
hiddenUnits?: number;
aggregationType?: 'mean' | 'sum' | 'max';
numLayers?: number;
activation?: 'relu' | 'tanh' | 'sigmoid' | 'linear';
maxLen?: number;
useTokenizer?: boolean;
}
export interface GraphELMResult {
label: string;
prob: number;
nodeFeatures?: number[];
}
export interface GraphNode {
id: string | number;
features: number[];
}
export interface GraphEdge {
source: string | number;
target: string | number;
weight?: number;
}
export interface Graph {
nodes: GraphNode[];
edges: GraphEdge[];
}
/**
* Graph ELM for graph-structured data
* Features:
* - Node feature learning
* - Graph structure encoding
* - Edge-aware classification
* - Graph convolution operations
*/
export declare class GraphELM {
private elm;
private categories;
private options;
private trained;
private nodeFeatureMap;
constructor(options: GraphELMOptions);
/**
* Train on graph data
* @param graphs Array of graphs
* @param y Labels for each graph (or node labels)
*/
train(graphs: Graph[], y: number[] | string[]): void;
/**
* Extract features from graph structure
*/
private _extractGraphFeatures;
/**
* Aggregate neighbor features
*/
private _aggregateNeighbors;
/**
* Combine self and neighbor features
*/
private _combineFeatures;
/**
* Aggregate all node features to graph level
*/
private _aggregateNodes;
/**
* Predict on graph
*/
predict(graph: Graph | Graph[], topK?: number): GraphELMResult[];
}
//# sourceMappingURL=graph-elm.d.ts.map