idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
156,900 | private GeneratorMain loadXMLSpecification ( ) { try { DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; dbf . setFeature ( "http://apache.org/xml/features/nonvalidating/load-external-dtd" , false ) ; URL url = ClassLoader . getSystemResource ( GENERATOR_SCHEMA_FILE ) ; if ( url != null ) { try { ... | Load the XML configuration file . | 413 | 6 |
156,901 | private void processElementDataset ( GeneratorMain gen , Node cur ) { // *** get parameters String seedstr = ( ( Element ) cur ) . getAttribute ( ATTR_SEED ) ; if ( clusterRandom != RandomFactory . DEFAULT && seedstr != null && seedstr . length ( ) > 0 ) { clusterRandom = new RandomFactory ( ( long ) ( ParseUtil . pars... | Process a dataset Element in the XML stream . | 319 | 9 |
156,902 | private void processElementCluster ( GeneratorMain gen , Node cur ) { int size = - 1 ; double overweight = 1.0 ; String sizestr = ( ( Element ) cur ) . getAttribute ( ATTR_SIZE ) ; if ( sizestr != null && sizestr . length ( ) > 0 ) { size = ( int ) ( ParseUtil . parseIntBase10 ( sizestr ) * sizescale ) ; } String name ... | Process a cluster Element in the XML stream . | 603 | 9 |
156,903 | private void processElementUniform ( GeneratorSingleCluster cluster , Node cur ) { double min = 0.0 ; double max = 1.0 ; String minstr = ( ( Element ) cur ) . getAttribute ( ATTR_MIN ) ; if ( minstr != null && minstr . length ( ) > 0 ) { min = ParseUtil . parseDouble ( minstr ) ; } String maxstr = ( ( Element ) cur ) .... | Process a uniform Element in the XML stream . | 269 | 9 |
156,904 | private void processElementNormal ( GeneratorSingleCluster cluster , Node cur ) { double mean = 0.0 ; double stddev = 1.0 ; String meanstr = ( ( Element ) cur ) . getAttribute ( ATTR_MEAN ) ; if ( meanstr != null && meanstr . length ( ) > 0 ) { mean = ParseUtil . parseDouble ( meanstr ) ; } String stddevstr = ( ( Eleme... | Process a normal Element in the XML stream . | 285 | 9 |
156,905 | private void processElementGamma ( GeneratorSingleCluster cluster , Node cur ) { double k = 1.0 ; double theta = 1.0 ; String kstr = ( ( Element ) cur ) . getAttribute ( ATTR_K ) ; if ( kstr != null && kstr . length ( ) > 0 ) { k = ParseUtil . parseDouble ( kstr ) ; } String thetastr = ( ( Element ) cur ) . getAttribut... | Process a gamma Element in the XML stream . | 282 | 9 |
156,906 | private void processElementRotate ( GeneratorSingleCluster cluster , Node cur ) { int axis1 = 0 ; int axis2 = 0 ; double angle = 0.0 ; String a1str = ( ( Element ) cur ) . getAttribute ( ATTR_AXIS1 ) ; if ( a1str != null && a1str . length ( ) > 0 ) { axis1 = ParseUtil . parseIntBase10 ( a1str ) ; } String a2str = ( ( E... | Process a rotate Element in the XML stream . | 436 | 9 |
156,907 | private void processElementTranslate ( GeneratorSingleCluster cluster , Node cur ) { double [ ] offset = null ; String vstr = ( ( Element ) cur ) . getAttribute ( ATTR_VECTOR ) ; if ( vstr != null && vstr . length ( ) > 0 ) { offset = parseVector ( vstr ) ; } if ( offset == null ) { throw new AbortException ( "No trans... | Process a translate Element in the XML stream . | 200 | 9 |
156,908 | private void processElementClipping ( GeneratorSingleCluster cluster , Node cur ) { double [ ] cmin = null , cmax = null ; String minstr = ( ( Element ) cur ) . getAttribute ( ATTR_MIN ) ; if ( minstr != null && minstr . length ( ) > 0 ) { cmin = parseVector ( minstr ) ; } String maxstr = ( ( Element ) cur ) . getAttri... | Process a clipping Element in the XML stream . | 265 | 9 |
156,909 | private void processElementStatic ( GeneratorMain gen , Node cur ) { String name = ( ( Element ) cur ) . getAttribute ( ATTR_NAME ) ; if ( name == null ) { throw new AbortException ( "No cluster name given in specification file." ) ; } ArrayList < double [ ] > points = new ArrayList <> ( ) ; // TODO: check for unknown ... | Process a static cluster Element in the XML stream . | 259 | 10 |
156,910 | private double [ ] parseVector ( String s ) { String [ ] entries = WHITESPACE_PATTERN . split ( s ) ; double [ ] d = new double [ entries . length ] ; for ( int i = 0 ; i < entries . length ; i ++ ) { try { d [ i ] = ParseUtil . parseDouble ( entries [ i ] ) ; } catch ( NumberFormatException e ) { throw new AbortExcept... | Parse a string into a vector . | 111 | 8 |
156,911 | public static NumberVector getPrototype ( Model model , Relation < ? extends NumberVector > relation ) { // Mean model contains a numeric Vector if ( model instanceof MeanModel ) { return DoubleVector . wrap ( ( ( MeanModel ) model ) . getMean ( ) ) ; } // Handle medoid models if ( model instanceof MedoidModel ) { retu... | Get the representative vector for a cluster model . | 156 | 9 |
156,912 | private long [ ] determinePreferenceVectorByApriori ( Relation < V > relation , ModifiableDBIDs [ ] neighborIDs , StringBuilder msg ) { int dimensionality = neighborIDs . length ; // database for apriori UpdatableDatabase apriori_db = new HashmapDatabase ( ) ; SimpleTypeInformation < ? > bitmeta = VectorFieldTypeInform... | Determines the preference vector with the apriori strategy . | 540 | 13 |
156,913 | private long [ ] determinePreferenceVectorByMaxIntersection ( ModifiableDBIDs [ ] neighborIDs , StringBuilder msg ) { int dimensionality = neighborIDs . length ; long [ ] preferenceVector = BitsUtil . zero ( dimensionality ) ; Map < Integer , ModifiableDBIDs > candidates = new HashMap <> ( dimensionality ) ; for ( int ... | Determines the preference vector with the max intersection strategy . | 317 | 12 |
156,914 | private int max ( Map < Integer , ModifiableDBIDs > candidates ) { int maxDim = - 1 , size = - 1 ; for ( Integer nextDim : candidates . keySet ( ) ) { int nextSet = candidates . get ( nextDim ) . size ( ) ; if ( size < nextSet ) { size = nextSet ; maxDim = nextDim ; } } return maxDim ; } | Returns the set with the maximum size contained in the specified map . | 84 | 13 |
156,915 | private int maxIntersection ( Map < Integer , ModifiableDBIDs > candidates , ModifiableDBIDs set ) { int maxDim = - 1 ; ModifiableDBIDs maxIntersection = null ; for ( Integer nextDim : candidates . keySet ( ) ) { DBIDs nextSet = candidates . get ( nextDim ) ; ModifiableDBIDs nextIntersection = DBIDUtil . intersection (... | Returns the index of the set having the maximum intersection set with the specified set contained in the specified map . | 160 | 21 |
156,916 | private RangeQuery < V > [ ] initRangeQueries ( Relation < V > relation , int dimensionality ) { @ SuppressWarnings ( "unchecked" ) RangeQuery < V > [ ] rangeQueries = ( RangeQuery < V > [ ] ) new RangeQuery [ dimensionality ] ; for ( int d = 0 ; d < dimensionality ; d ++ ) { rangeQueries [ d ] = relation . getRangeQue... | Initializes the dimension selecting distancefunctions to determine the preference vectors . | 123 | 14 |
156,917 | @ Reference ( authors = "F. J. Rohlf" , title = "Methods of comparing classifications" , // booktitle = "Annual Review of Ecology and Systematics" , // url = "https://doi.org/10.1146/annurev.es.05.110174.000533" , // bibkey = "doi:10.1146/annurev.es.05.110174.000533" ) public double computeTau ( long c , long d , doubl... | Compute the Tau correlation measure | 186 | 6 |
156,918 | public void checkServices ( String update ) { TreeSet < String > props = new TreeSet <> ( ) ; Enumeration < URL > us ; try { us = getClass ( ) . getClassLoader ( ) . getResources ( ELKIServiceLoader . RESOURCE_PREFIX ) ; } catch ( IOException e ) { throw new AbortException ( "Error enumerating service folders." , e ) ;... | Retrieve all properties and check them . | 449 | 8 |
156,919 | @ SuppressWarnings ( "unchecked" ) private void checkAliases ( Class < ? > parent , String classname , String [ ] parts ) { Class < ? > c = ELKIServiceRegistry . findImplementation ( ( Class < Object > ) parent , classname ) ; if ( c == null ) { return ; } Alias ann = c . getAnnotation ( Alias . class ) ; if ( ann == n... | Check if aliases are listed completely . | 486 | 7 |
156,920 | public LinearEquationSystem getNormalizedLinearEquationSystem ( Normalization < ? > normalization ) throws NonNumericFeaturesException { if ( normalization != null ) { LinearEquationSystem lq = normalization . transform ( linearEquationSystem ) ; lq . solveByTotalPivotSearch ( ) ; return lq ; } else { return linearEqua... | Returns the linear equation system for printing purposes . If normalization is null the linear equation system is returned otherwise the linear equation system will be transformed according to the normalization . | 82 | 34 |
156,921 | public double squaredDistance ( V p ) { // V_affin = V + a // dist(p, V_affin) = d(p-a, V) = ||p - a - proj_V(p-a) || double [ ] p_minus_a = minusEquals ( p . toArray ( ) , centroid ) ; return squareSum ( minusEquals ( p_minus_a , times ( strongEigenvectors , transposeTimes ( strongEigenvectors , p_minus_a ) ) ) ) ; } | Returns the distance of NumberVector p from the hyperplane underlying this solution . | 120 | 15 |
156,922 | public double [ ] errorVector ( V p ) { return weakEigenvectors . length > 0 ? times ( weakEigenvectors , transposeTimes ( weakEigenvectors , minusEquals ( p . toArray ( ) , centroid ) ) ) : EMPTY_VECTOR ; } | Returns the error vectors after projection . | 65 | 7 |
156,923 | public double [ ] dataVector ( V p ) { return strongEigenvectors . length > 0 ? times ( strongEigenvectors , transposeTimes ( strongEigenvectors , minusEquals ( p . toArray ( ) , centroid ) ) ) : EMPTY_VECTOR ; } | Returns the data vectors after projection . | 65 | 7 |
156,924 | @ Override public void writeToText ( TextWriterStream out , String label ) { if ( label != null ) { out . commentPrintLn ( label ) ; } out . commentPrintLn ( "Model class: " + this . getClass ( ) . getName ( ) ) ; try { if ( getNormalizedLinearEquationSystem ( null ) != null ) { // TODO: more elegant way of doing norma... | Text output of the equation system | 272 | 6 |
156,925 | protected int getBinNr ( double coord ) { if ( Double . isInfinite ( coord ) || Double . isNaN ( coord ) ) { throw new UnsupportedOperationException ( "Encountered non-finite value in Histogram: " + coord ) ; } if ( coord == max ) { // System.err.println("Triggered special case: "+ (Math.floor((coord - // base) / binsi... | Compute the bin number . Has a special case for rounding max down to the last bin . | 135 | 19 |
156,926 | protected static int growSize ( int current , int requiredSize ) { // Double until 64, then increase by 50% each time. int newCapacity = ( ( current < 64 ) ? ( ( current + 1 ) << 1 ) : ( ( current >> 1 ) * 3 ) ) ; // overflow? if ( newCapacity < 0 ) { throw new OutOfMemoryError ( ) ; } if ( requiredSize > newCapacity )... | Compute the size to grow to . | 105 | 8 |
156,927 | private void expandNodes ( DeLiCluTree index , SpatialPrimitiveDistanceFunction < V > distFunction , SpatialObjectPair nodePair , DataStore < KNNList > knns ) { DeLiCluNode node1 = index . getNode ( ( ( SpatialDirectoryEntry ) nodePair . entry1 ) . getPageID ( ) ) ; DeLiCluNode node2 = index . getNode ( ( ( SpatialDire... | Expands the spatial nodes of the specified pair . | 187 | 10 |
156,928 | private void expandDirNodes ( SpatialPrimitiveDistanceFunction < V > distFunction , DeLiCluNode node1 , DeLiCluNode node2 ) { if ( LOG . isDebuggingFinest ( ) ) { LOG . debugFinest ( "ExpandDirNodes: " + node1 . getPageID ( ) + " + " + node2 . getPageID ( ) ) ; } int numEntries_1 = node1 . getNumEntries ( ) ; int numEn... | Expands the specified directory nodes . | 288 | 7 |
156,929 | private void expandLeafNodes ( SpatialPrimitiveDistanceFunction < V > distFunction , DeLiCluNode node1 , DeLiCluNode node2 , DataStore < KNNList > knns ) { if ( LOG . isDebuggingFinest ( ) ) { LOG . debugFinest ( "ExpandLeafNodes: " + node1 . getPageID ( ) + " + " + node2 . getPageID ( ) ) ; } int numEntries_1 = node1 ... | Expands the specified leaf nodes . | 340 | 7 |
156,930 | private void reinsertExpanded ( SpatialPrimitiveDistanceFunction < V > distFunction , DeLiCluTree index , IndexTreePath < DeLiCluEntry > path , DataStore < KNNList > knns ) { int l = 0 ; // Count the number of components. for ( IndexTreePath < DeLiCluEntry > it = path ; it != null ; it = it . getParentPath ( ) ) { l ++... | Reinserts the objects of the already expanded nodes . | 229 | 11 |
156,931 | public static int assertSameDimensionality ( SpatialComparable box1 , SpatialComparable box2 ) { final int dim = box1 . getDimensionality ( ) ; if ( dim != box2 . getDimensionality ( ) ) { throw new IllegalArgumentException ( "The spatial objects do not have the same dimensionality!" ) ; } return dim ; } | Check that two spatial objects have the same dimensionality . | 79 | 11 |
156,932 | public static double [ ] getMin ( SpatialComparable box ) { final int dim = box . getDimensionality ( ) ; double [ ] min = new double [ dim ] ; for ( int i = 0 ; i < dim ; i ++ ) { min [ i ] = box . getMin ( i ) ; } return min ; } | Returns a clone of the minimum hyper point . | 72 | 9 |
156,933 | public static double [ ] getMax ( SpatialComparable box ) { final int dim = box . getDimensionality ( ) ; double [ ] max = new double [ dim ] ; for ( int i = 0 ; i < dim ; i ++ ) { max [ i ] = box . getMax ( i ) ; } return max ; } | Returns a clone of the maximum hyper point . | 72 | 9 |
156,934 | public static boolean intersects ( SpatialComparable box1 , SpatialComparable box2 ) { final int dim = assertSameDimensionality ( box1 , box2 ) ; for ( int i = 0 ; i < dim ; i ++ ) { if ( box2 . getMax ( i ) < box1 . getMin ( i ) || box1 . getMax ( i ) < box2 . getMin ( i ) ) { return false ; } } return true ; } | Returns true if the two SpatialComparables intersect false otherwise . | 101 | 13 |
156,935 | public static boolean contains ( SpatialComparable box , double [ ] point ) { final int dim = box . getDimensionality ( ) ; if ( dim != point . length ) { throw new IllegalArgumentException ( "This HyperBoundingBox and the given point need same dimensionality" ) ; } for ( int i = 0 ; i < dim ; i ++ ) { if ( box . getMi... | Returns true if this SpatialComparable contains the given point false otherwise . | 117 | 15 |
156,936 | public static double enlargement ( SpatialComparable exist , SpatialComparable addit ) { final int dim = assertSameDimensionality ( exist , addit ) ; double v1 = 1. ; double v2 = 1. ; for ( int i = 0 ; i < dim ; i ++ ) { final double emin = exist . getMin ( i ) ; final double emax = exist . getMax ( i ) ; final double ... | Compute the enlargement obtained by adding an object to an existing object . | 180 | 15 |
156,937 | public static double perimeter ( SpatialComparable box ) { final int dim = box . getDimensionality ( ) ; double perimeter = 0. ; for ( int i = 0 ; i < dim ; i ++ ) { perimeter += box . getMax ( i ) - box . getMin ( i ) ; } return perimeter ; } | Computes the perimeter of this SpatialComparable . | 69 | 11 |
156,938 | public static double overlap ( SpatialComparable box1 , SpatialComparable box2 ) { final int dim = assertSameDimensionality ( box1 , box2 ) ; // the maximal and minimal value of the overlap box. double omax , omin ; // the overlap volume double overlap = 1. ; for ( int i = 0 ; i < dim ; i ++ ) { // The maximal value of... | Computes the volume of the overlapping box between two SpatialComparables . | 207 | 15 |
156,939 | public static double relativeOverlap ( SpatialComparable box1 , SpatialComparable box2 ) { final int dim = assertSameDimensionality ( box1 , box2 ) ; // the overlap volume double overlap = 1. ; double vol1 = 1. ; double vol2 = 1. ; for ( int i = 0 ; i < dim ; i ++ ) { final double box1min = box1 . getMin ( i ) ; final ... | Computes the volume of the overlapping box between two SpatialComparables and return the relation between the volume of the overlapping box and the volume of both SpatialComparable . | 249 | 35 |
156,940 | public static ModifiableHyperBoundingBox unionTolerant ( SpatialComparable mbr1 , SpatialComparable mbr2 ) { if ( mbr1 == null && mbr2 == null ) { return null ; } if ( mbr1 == null ) { // Clone - intentionally return new ModifiableHyperBoundingBox ( mbr2 ) ; } if ( mbr2 == null ) { // Clone - intentionally return new M... | Returns the union of the two specified MBRs . Tolerant of null values . | 118 | 17 |
156,941 | public static double [ ] centroid ( SpatialComparable obj ) { final int dim = obj . getDimensionality ( ) ; double [ ] centroid = new double [ dim ] ; for ( int d = 0 ; d < dim ; d ++ ) { centroid [ d ] = ( obj . getMax ( d ) + obj . getMin ( d ) ) * .5 ; } return centroid ; } | Returns the centroid of this SpatialComparable . | 88 | 11 |
156,942 | public static LinearScaling fromMinMax ( double min , double max ) { double zoom = 1.0 / ( max - min ) ; return new LinearScaling ( zoom , - min * zoom ) ; } | Make a linear scaling from a given minimum and maximum . The minimum will be mapped to zero the maximum to one . | 44 | 23 |
156,943 | public double fMeasure ( double beta ) { final double beta2 = beta * beta ; double fmeasure = ( ( 1 + beta2 ) * pairconfuse [ 0 ] ) / ( ( 1 + beta2 ) * pairconfuse [ 0 ] + beta2 * pairconfuse [ 1 ] + pairconfuse [ 2 ] ) ; return fmeasure ; } | Get the pair - counting F - Measure | 78 | 8 |
156,944 | @ Override public void write ( TextWriterStream out , String label , Object object ) { StringBuilder buf = new StringBuilder ( 100 ) ; if ( label != null ) { buf . append ( label ) . append ( ' ' ) ; } if ( object != null ) { buf . append ( object . toString ( ) ) ; } out . commentPrintLn ( buf ) ; } | Put an object into the comment section | 82 | 7 |
156,945 | protected static < I > double [ ] [ ] computeSquaredDistanceMatrix ( final List < I > col , PrimitiveDistanceFunction < ? super I > dist ) { final int size = col . size ( ) ; double [ ] [ ] imat = new double [ size ] [ size ] ; boolean squared = dist . isSquared ( ) ; FiniteProgress dprog = LOG . isVerbose ( ) ? new Fi... | Compute the squared distance matrix . | 275 | 7 |
156,946 | private OutlierResult getOutlierResult ( ResultHierarchy hier , Result result ) { List < OutlierResult > ors = ResultUtil . filterResults ( hier , result , OutlierResult . class ) ; if ( ! ors . isEmpty ( ) ) { return ors . get ( 0 ) ; } throw new IllegalStateException ( "Comparison algorithm expected at least one outl... | Find an OutlierResult to work with . | 89 | 9 |
156,947 | protected PolynomialApproximation knnDistanceApproximation ( ) { int p_max = 0 ; double [ ] b = null ; for ( int i = 0 ; i < getNumEntries ( ) ; i ++ ) { MkAppEntry entry = getEntry ( i ) ; PolynomialApproximation approximation = entry . getKnnDistanceApproximation ( ) ; if ( b == null ) { p_max = approximation . getPo... | Determines and returns the polynomial approximation for the knn distances of this node as the maximum of the polynomial approximations of all entries . | 261 | 33 |
156,948 | public void setDBIDs ( DBIDs ids ) { this . idrep . setDBIDs ( ids ) ; // Update relations. for ( Relation < ? > orel : this . relations ) { if ( orel instanceof ProxyView ) { ( ( ProxyView < ? > ) orel ) . setDBIDs ( this . idrep . getDBIDs ( ) ) ; } } } | Set the DBIDs to use . | 85 | 7 |
156,949 | public synchronized Collection < Progress > getProgresses ( ) { List < Progress > list = new ArrayList <> ( progresses . size ( ) ) ; Iterator < WeakReference < Progress > > iter = progresses . iterator ( ) ; while ( iter . hasNext ( ) ) { WeakReference < Progress > ref = iter . next ( ) ; if ( ref . get ( ) == null ) ... | Get a list of progresses tracked . | 108 | 7 |
156,950 | public synchronized void addProgress ( Progress p ) { // Don't add more than once. Iterator < WeakReference < Progress >> iter = progresses . iterator ( ) ; while ( iter . hasNext ( ) ) { WeakReference < Progress > ref = iter . next ( ) ; // since we are at it anyway, remove old links. if ( ref . get ( ) == null ) { it... | Add a new Progress to the tracker . | 120 | 8 |
156,951 | public synchronized IndexTreePath < DeLiCluEntry > setHandled ( DBID id , O obj ) { if ( LOG . isDebugging ( ) ) { LOG . debugFine ( "setHandled " + id + ", " + obj + "\n" ) ; } // find the leaf node containing o IndexTreePath < DeLiCluEntry > pathToObject = findPathToObject ( getRootPath ( ) , obj , id ) ; if ( pathTo... | Marks the specified object as handled and returns the path of node ids from the root to the objects s parent . | 358 | 24 |
156,952 | @ Override public final boolean delete ( DBIDRef id ) { // find the leaf node containing o O obj = relation . get ( id ) ; IndexTreePath < DeLiCluEntry > deletionPath = findPathToObject ( getRootPath ( ) , obj , id ) ; if ( deletionPath == null ) { return false ; } deletePath ( deletionPath ) ; return true ; } | Deletes the specified object from this index . | 83 | 9 |
156,953 | protected double [ ] makeSample ( int maxk ) { final Random rnd = this . rnd . getSingleThreadedRandom ( ) ; double [ ] dists = new double [ maxk + 1 ] ; final double e = 1. / dim ; for ( int i = 0 ; i <= maxk ; i ++ ) { dists [ i ] = FastMath . pow ( rnd . nextDouble ( ) , e ) ; } Arrays . sort ( dists ) ; return dist... | Generate a data sample . | 107 | 6 |
156,954 | @ Override public final boolean setRoutingObjectID ( DBID objectID ) { if ( objectID == routingObjectID || DBIDUtil . equal ( objectID , routingObjectID ) ) { return false ; } this . routingObjectID = objectID ; return true ; } | Sets the id of the routing object of this entry . | 60 | 12 |
156,955 | @ Override public void writeExternal ( ObjectOutput out ) throws IOException { out . writeInt ( id ) ; out . writeInt ( DBIDUtil . asInteger ( routingObjectID ) ) ; out . writeDouble ( parentDistance ) ; out . writeDouble ( coveringRadius ) ; } | Calls the super method and writes the routingObjectID the parentDistance and the coveringRadius of this entry to the specified stream . | 63 | 27 |
156,956 | @ Override public void write ( TextWriterStream out , String label , TextWriteable obj ) { obj . writeToText ( out , label ) ; } | Use the objects own text serialization . | 33 | 8 |
156,957 | protected void evaluteResult ( Database db , Clustering < ? > c , Clustering < ? > refc ) { ClusterContingencyTable contmat = new ClusterContingencyTable ( selfPairing , noiseSpecialHandling ) ; contmat . process ( refc , c ) ; ScoreResult sr = new ScoreResult ( contmat ) ; sr . addHeader ( c . getLongName ( ) ) ; db .... | Evaluate a clustering result . | 107 | 8 |
156,958 | private boolean isReferenceResult ( Clustering < ? > t ) { // FIXME: don't hard-code strings return "bylabel-clustering" . equals ( t . getShortName ( ) ) // || "bymodel-clustering" . equals ( t . getShortName ( ) ) // || "allinone-clustering" . equals ( t . getShortName ( ) ) // || "allinnoise-clustering" . equals ( t... | Test if a clustering result is a valid reference result . | 112 | 12 |
156,959 | @ Override public final synchronized int writePage ( P page ) { int pageid = setPageID ( page ) ; writePage ( pageid , page ) ; return pageid ; } | Writes a page into this file . The method tests if the page has already an id otherwise a new id is assigned and returned . | 39 | 27 |
156,960 | public static Element drawManhattan ( SVGPlot svgp , Projection2D proj , NumberVector mid , double radius ) { final double [ ] v_mid = mid . toArray ( ) ; // a copy final long [ ] dims = proj . getVisibleDimensions2D ( ) ; SVGPath path = new SVGPath ( ) ; for ( int dim = BitsUtil . nextSetBit ( dims , 0 ) ; dim >= 0 ; ... | Wireframe manhattan hypersphere | 468 | 7 |
156,961 | public static Element drawCross ( SVGPlot svgp , Projection2D proj , NumberVector mid , double radius ) { final double [ ] v_mid = mid . toArray ( ) ; final long [ ] dims = proj . getVisibleDimensions2D ( ) ; SVGPath path = new SVGPath ( ) ; for ( int dim = BitsUtil . nextSetBit ( dims , 0 ) ; dim >= 0 ; dim = BitsUtil... | Wireframe cross hypersphere | 234 | 6 |
156,962 | @ SuppressWarnings ( { "cast" , "unchecked" } ) public static < O extends SpatialComparable > RangeQuery < O > getRangeQuery ( AbstractRStarTree < ? , ? , ? > tree , SpatialDistanceQuery < O > distanceQuery , Object ... hints ) { // Can we support this distance function - spatial distances only! SpatialPrimitiveDistanc... | Get an RTree range query using an optimized double implementation when possible . | 182 | 14 |
156,963 | @ SuppressWarnings ( { "cast" , "unchecked" } ) public static < O extends SpatialComparable > KNNQuery < O > getKNNQuery ( AbstractRStarTree < ? , ? , ? > tree , SpatialDistanceQuery < O > distanceQuery , Object ... hints ) { // Can we support this distance function - spatial distances only! SpatialPrimitiveDistanceFun... | Get an RTree knn query using an optimized double implementation when possible . | 187 | 15 |
156,964 | private void privateReconfigureLogging ( String pkg , final String name ) { LogManager logManager = LogManager . getLogManager ( ) ; Logger logger = Logger . getLogger ( LoggingConfiguration . class . getName ( ) ) ; // allow null as package name. if ( pkg == null ) { pkg = "" ; } // Load logging configuration from cur... | Reconfigure logging . | 335 | 5 |
156,965 | private static InputStream openSystemFile ( String filename ) throws FileNotFoundException { try { return new FileInputStream ( filename ) ; } catch ( FileNotFoundException e ) { // try with classloader String resname = File . separatorChar != ' ' ? filename . replace ( File . separatorChar , ' ' ) : filename ; ClassLo... | Private copy from FileUtil to avoid cross - dependencies . Try to open a file first trying the file system then falling back to the classpath . | 218 | 30 |
156,966 | public static void setVerbose ( java . util . logging . Level verbose ) { if ( verbose . intValue ( ) <= Level . VERBOSE . intValue ( ) ) { // decrease to VERBOSE if it was higher, otherwise further to // VERYVERBOSE if ( LOGGER_GLOBAL_TOP . getLevel ( ) == null || LOGGER_GLOBAL_TOP . getLevel ( ) . intValue ( ) > verb... | Reconfigure logging to enable verbose logging at the top level . | 379 | 14 |
156,967 | public static void setStatistics ( ) { // decrease to INFO if it was higher if ( LOGGER_GLOBAL_TOP . getLevel ( ) == null || LOGGER_GLOBAL_TOP . getLevel ( ) . intValue ( ) > Level . STATISTICS . intValue ( ) ) { LOGGER_GLOBAL_TOP . setLevel ( Level . STATISTICS ) ; } if ( LOGGER_ELKI_TOP . getLevel ( ) == null || LOGG... | Enable runtime performance logging . | 215 | 5 |
156,968 | public static void replaceDefaultHandler ( Handler handler ) { Logger rootlogger = LogManager . getLogManager ( ) . getLogger ( "" ) ; for ( Handler h : rootlogger . getHandlers ( ) ) { if ( h instanceof CLISmartHandler ) { rootlogger . removeHandler ( h ) ; } } addHandler ( handler ) ; } | Replace the default log handler with the given log handler . | 79 | 12 |
156,969 | public static void setDefaultLevel ( java . util . logging . Level level ) { Logger . getLogger ( TOPLEVEL_PACKAGE ) . setLevel ( level ) ; } | Set the default level . | 40 | 5 |
156,970 | public static double [ ] getRelativeCoordinates ( Event evt , Element reference ) { if ( evt instanceof DOMMouseEvent && reference instanceof SVGLocatable && reference instanceof SVGElement ) { // Get the screen (pixel!) coordinates DOMMouseEvent gnme = ( DOMMouseEvent ) evt ; SVGMatrix mat = ( ( SVGLocatable ) referen... | Get the relative coordinates of a point within the coordinate system of a particular SVG Element . | 230 | 17 |
156,971 | public Clustering < MeanModel > run ( Relation < NumberVector > relation ) { final int dim = RelationUtil . dimensionality ( relation ) ; CFTree tree = cffactory . newTree ( relation . getDBIDs ( ) , relation ) ; // The CFTree does not store points. We have to reassign them (and the // quality is better than if we used... | Run the clustering algorithm . | 394 | 6 |
156,972 | public OutlierResult run ( Database database , Relation < O > relation ) { // Get a nearest neighbor query on the relation. KNNQuery < O > knnq = QueryUtil . getKNNQuery ( relation , getDistanceFunction ( ) , k ) ; // Output data storage WritableDoubleDataStore scores = DataStoreUtil . makeDoubleStorage ( relation . ge... | Run the outlier detection algorithm | 387 | 6 |
156,973 | public static void main ( String [ ] args ) { if ( args . length > 0 && args [ 0 ] . charAt ( 0 ) != ' ' ) { Class < ? > cls = ELKIServiceRegistry . findImplementation ( AbstractApplication . class , args [ 0 ] ) ; if ( cls != null ) { try { Method m = cls . getMethod ( "main" , String [ ] . class ) ; Object a = Arrays... | Launch ELKI . | 226 | 4 |
156,974 | public static Parameterizer getParameterizer ( Class < ? > c ) { for ( Class < ? > inner : c . getDeclaredClasses ( ) ) { if ( Parameterizer . class . isAssignableFrom ( inner ) ) { try { return inner . asSubclass ( Parameterizer . class ) . newInstance ( ) ; } catch ( Exception e ) { LOG . warning ( "Non-usable Parame... | Get a parameterizer for the given class . | 112 | 9 |
156,975 | private void putRec ( O obj , Rec < O > rec ) { graph . put ( obj , rec ) ; for ( int i = 0 ; i < numelems ; ++ i ) { if ( obj == elems [ i ] ) { return ; } } if ( elems . length == numelems ) { elems = Arrays . copyOf ( elems , ( elems . length << 1 ) + 1 ) ; } elems [ numelems ++ ] = obj ; } | Put a record . | 105 | 4 |
156,976 | private void removeRec ( O obj ) { graph . remove ( obj ) ; for ( int i = 0 ; i < numelems ; ++ i ) { if ( obj == elems [ i ] ) { System . arraycopy ( elems , i + 1 , elems , i , -- numelems - i ) ; elems [ numelems ] = null ; return ; } } } | Remove a record . | 84 | 4 |
156,977 | protected JTree createTree ( ) { JTree tree = new JTree ( model ) ; tree . setName ( "TreePopup.tree" ) ; tree . setFont ( getFont ( ) ) ; tree . setForeground ( getForeground ( ) ) ; tree . setBackground ( getBackground ( ) ) ; tree . setBorder ( null ) ; tree . setFocusable ( true ) ; tree . addMouseListener ( handle... | Creates the JList used in the popup to display the items in the combo box model . This method is called when the UI class is created . | 122 | 30 |
156,978 | protected JScrollPane createScroller ( ) { JScrollPane sp = new JScrollPane ( tree , ScrollPaneConstants . VERTICAL_SCROLLBAR_AS_NEEDED , ScrollPaneConstants . HORIZONTAL_SCROLLBAR_NEVER ) ; sp . setHorizontalScrollBar ( null ) ; sp . setName ( "TreePopup.scrollPane" ) ; sp . setFocusable ( false ) ; sp . getVerticalSc... | Creates the scroll pane which houses the scrollable tree . | 133 | 12 |
156,979 | public void show ( Component parent ) { Dimension parentSize = parent . getSize ( ) ; Insets insets = getInsets ( ) ; // reduce the width of the scrollpane by the insets so that the popup // is the same width as the combo box. parentSize . setSize ( parentSize . width - ( insets . right + insets . left ) , 10 * parentS... | Display the popup attached to the given component . | 186 | 9 |
156,980 | protected void fireActionPerformed ( ActionEvent event ) { Object [ ] listeners = listenerList . getListenerList ( ) ; for ( int i = listeners . length - 2 ; i >= 0 ; i -= 2 ) { if ( listeners [ i ] == ActionListener . class ) { ( ( ActionListener ) listeners [ i + 1 ] ) . actionPerformed ( event ) ; } } } | Notify action listeners . | 82 | 5 |
156,981 | private < T > void setCached ( String prefix , String postfix , T data ) { cache . put ( prefix + ' ' + postfix , data ) ; } | Set a cache value | 36 | 4 |
156,982 | protected String getPropertyValue ( String prefix , String postfix ) { String ret = properties . getProperty ( prefix + "." + postfix ) ; if ( ret != null ) { // logger.debugFine("Found property: "+prefix + "." + // postfix+" for "+prefix); return ret ; } int pos = prefix . length ( ) ; while ( pos > 0 ) { pos = prefix... | Retrieve the property value for a particular path + type pair . | 220 | 13 |
156,983 | @ SuppressWarnings ( "unchecked" ) public static < V extends NumberVector > NumberVector . Factory < V > guessFactory ( SimpleTypeInformation < V > in ) { NumberVector . Factory < V > factory = null ; if ( in instanceof VectorTypeInformation ) { factory = ( NumberVector . Factory < V > ) ( ( VectorTypeInformation < V >... | Try to guess the appropriate factory . | 194 | 7 |
156,984 | public void appendSimple ( Object ... data ) { if ( data . length != meta . size ( ) ) { throw new AbortException ( "Invalid number of attributes in 'append'." ) ; } for ( int i = 0 ; i < data . length ; i ++ ) { @ SuppressWarnings ( "unchecked" ) final List < Object > col = ( List < Object > ) columns . get ( i ) ; co... | Append a new record to the data set . Pay attention to having the right number of values! | 102 | 20 |
156,985 | public static MultipleObjectsBundle fromStream ( BundleStreamSource source ) { MultipleObjectsBundle bundle = new MultipleObjectsBundle ( ) ; boolean stop = false ; DBIDVar var = null ; ArrayModifiableDBIDs ids = null ; int size = 0 ; while ( ! stop ) { BundleStreamSource . Event ev = source . nextEvent ( ) ; switch ( ... | Convert an object stream to a bundle | 474 | 8 |
156,986 | public Object [ ] getRow ( int row ) { Object [ ] ret = new Object [ columns . size ( ) ] ; for ( int c = 0 ; c < columns . size ( ) ; c ++ ) { ret [ c ] = data ( row , c ) ; } return ret ; } | Get an object row . | 62 | 5 |
156,987 | protected void batchNN ( AbstractRStarTreeNode < ? , ? > node , Map < DBID , KNNHeap > knnLists ) { if ( node . isLeaf ( ) ) { for ( int i = 0 ; i < node . getNumEntries ( ) ; i ++ ) { SpatialEntry p = node . getEntry ( i ) ; for ( Entry < DBID , KNNHeap > ent : knnLists . entrySet ( ) ) { final DBID q = ent . getKey (... | Performs a batch knn query . | 494 | 8 |
156,988 | protected List < DoubleDistanceEntry > getSortedEntries ( AbstractRStarTreeNode < ? , ? > node , DBIDs ids ) { List < DoubleDistanceEntry > result = new ArrayList <> ( ) ; for ( int i = 0 ; i < node . getNumEntries ( ) ; i ++ ) { SpatialEntry entry = node . getEntry ( i ) ; double minMinDist = Double . MAX_VALUE ; for ... | Sorts the entries of the specified node according to their minimum distance to the specified objects . | 197 | 18 |
156,989 | private boolean checkCandidateUpdate ( double [ ] point ) { final double x = point [ 0 ] , y = point [ 1 ] ; if ( points . isEmpty ( ) ) { leftx = rightx = x ; topy = bottomy = y ; topleft = topright = bottomleft = bottomright = point ; return true ; } // A non-regular diamond spanned by left, top, right, and bottom. i... | Check whether a point is inside the current bounds and update the bounds | 358 | 13 |
156,990 | static DBIDs randomSample ( DBIDs ids , int samplesize , Random rnd , DBIDs previous ) { if ( previous == null ) { return DBIDUtil . randomSample ( ids , samplesize , rnd ) ; } ModifiableDBIDs sample = DBIDUtil . newHashSet ( samplesize ) ; sample . addDBIDs ( previous ) ; sample . addDBIDs ( DBIDUtil . randomSample ( ... | Draw a random sample of the desired size . | 247 | 9 |
156,991 | @ Override public void actionPerformed ( ActionEvent e ) { // Use a new JFileChooser. Inconsistent behaviour otherwise! final JFileChooser fc = new JFileChooser ( new File ( "." ) ) ; if ( param . isDefined ( ) ) { fc . setSelectedFile ( param . getValue ( ) ) ; } if ( e . getSource ( ) == button ) { int returnVal = fc... | Button callback to show the file selector | 212 | 7 |
156,992 | protected Node inlineThumbnail ( Document doc , ParsedURL urldata , Node eold ) { RenderableImage img = ThumbnailRegistryEntry . handleURL ( urldata ) ; if ( img == null ) { LoggingUtil . warning ( "Image not found in registry: " + urldata . toString ( ) ) ; return null ; } ByteArrayOutputStream os = new ByteArrayOutpu... | Inline a referenced thumbnail . | 285 | 6 |
156,993 | private static PrintStream openStream ( File out ) throws IOException { OutputStream os = new FileOutputStream ( out ) ; os = out . getName ( ) . endsWith ( GZIP_POSTFIX ) ? new GZIPOutputStream ( os ) : os ; return new PrintStream ( os ) ; } | Open the output stream using gzip if necessary . | 67 | 10 |
156,994 | @ Override public void setDimensionality ( int dimensionality ) throws IllegalArgumentException { final int maxdim = getMaxDim ( ) ; if ( maxdim > dimensionality ) { throw new IllegalArgumentException ( "Given dimensionality " + dimensionality + " is too small w.r.t. the given values (occurring maximum: " + maxdim + ")... | Sets the dimensionality to the new value . | 93 | 10 |
156,995 | protected IndexTreePath < E > findPathToObject ( IndexTreePath < E > subtree , SpatialComparable mbr , DBIDRef id ) { N node = getNode ( subtree . getEntry ( ) ) ; if ( node . isLeaf ( ) ) { for ( int i = 0 ; i < node . getNumEntries ( ) ; i ++ ) { if ( DBIDUtil . equal ( ( ( LeafEntry ) node . getEntry ( i ) ) . getDB... | Returns the path to the leaf entry in the specified subtree that represents the data object with the specified mbr and id . | 262 | 25 |
156,996 | protected void deletePath ( IndexTreePath < E > deletionPath ) { N leaf = getNode ( deletionPath . getParentPath ( ) . getEntry ( ) ) ; int index = deletionPath . getIndex ( ) ; // delete o E entry = leaf . getEntry ( index ) ; leaf . deleteEntry ( index ) ; writeNode ( leaf ) ; // condense the tree Stack < N > stack =... | Delete a leaf at a given path - deletions for non - leaves are not supported! | 271 | 18 |
156,997 | protected List < E > createBulkLeafNodes ( List < E > objects ) { int minEntries = leafMinimum ; int maxEntries = leafCapacity ; ArrayList < E > result = new ArrayList <> ( ) ; List < List < E > > partitions = settings . bulkSplitter . partition ( objects , minEntries , maxEntries ) ; for ( List < E > partition : parti... | Creates and returns the leaf nodes for bulk load . | 240 | 11 |
156,998 | protected IndexTreePath < E > choosePath ( IndexTreePath < E > subtree , SpatialComparable mbr , int depth , int cur ) { if ( getLogger ( ) . isDebuggingFiner ( ) ) { getLogger ( ) . debugFiner ( "node " + subtree + ", depth " + depth ) ; } N node = getNode ( subtree . getEntry ( ) ) ; if ( node == null ) { throw new R... | Chooses the best path of the specified subtree for insertion of the given mbr at the specified level . | 383 | 22 |
156,999 | private N split ( N node ) { // choose the split dimension and the split point int minimum = node . isLeaf ( ) ? leafMinimum : dirMinimum ; long [ ] split = settings . nodeSplitter . split ( node , NodeArrayAdapter . STATIC , minimum ) ; // New node final N newNode = node . isLeaf ( ) ? createNewLeafNode ( ) : createNe... | Splits the specified node and returns the newly created split node . | 129 | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.