public Instance filterInstance(Instance x) {


		if(dataset==null){
			initialize(x);
		}		

		double z_[] = new double[H+1];

		int d = x.numAttributes() - 1; // suppose one class attribute (at the end)

		for(int k = 0; k < H; k++) {
			// for each hidden unit ...
			double a_k = 0.; 								// k-th activation (dot product)
			for(int j = 0; j < d; j++) {
				a_k += (x.value(j) * W[k][j]);
			}
			z_[k] = (a_k > 0. ? a_k : 0.);				  // <------- can change threshold here
		}
		z_[H] = x.classValue();

		Instance z = new InstanceImpl(x.weight(),z_);
		z.setDataset(dataset);

		return z;
	}
public Instance filterInstance ( Instance x ) { if ( dataset == null ) { initialize ( x ) ; } double z_ [ ] = new double [ H + 1 ] ; int d = x . numAttributes ( ) - 1 ; for ( int k = 0 ; k < H ; k ++ ) { double a_k = 0. ; for ( int j = 0 ; j < d ; j ++ ) { a_k += ( x . value ( j ) * W [ k ] [ j ] ) ; } z_ [ k ] = ( a_k > 0. ? a_k : 0. ) ; } z_ [ H ] = x . classValue ( ) ; Instance z = new InstanceImpl ( x . weight ( ) , z_ ) ; z . setDataset ( dataset ) ; return z ; }
Filter an instance.
Assume that the instance has a single class label, as the final attribute. Note that this may not always be the case!

@param	x	input instance
@return	output instance