@@ -18,7 +18,7 @@ public abstract class Boosting implements Serializable {
1818 private static final Logger logger = LoggerFactory .getLogger (Boosting .class );
1919 private static final long serialVersionUID = -3370589073161617590L ;
2020
21- static Boosting createBoosting (String filename ) throws FileNotFoundException , IOException {
21+ public static Boosting createBoosting (String filename ) throws IOException {
2222 String type = getBoostingTypeFromModelFile (filename );
2323 Boosting boosting = null ;
2424 if (type .equals ("tree" )) {
@@ -30,7 +30,7 @@ static Boosting createBoosting(String filename) throws FileNotFoundException, IO
3030 return boosting ;
3131 }
3232
33- static Boosting createBoosting (String type , String filename ) throws FileNotFoundException , IOException {
33+ public static Boosting createBoosting (String type , String filename ) throws FileNotFoundException , IOException {
3434 if (filename == null || filename .length () == 0 ) {
3535 if (type .equals ("gbdt" )) {
3636 return new GBDT ();
@@ -62,7 +62,7 @@ static Boosting createBoosting(String type, String filename) throws FileNotFound
6262 }
6363 }
6464
65- static boolean loadFileToBoosting (Boosting boosting , String filename ) throws FileNotFoundException , IOException {
65+ public static boolean loadFileToBoosting (Boosting boosting , String filename ) throws IOException {
6666 if (boosting != null ) {
6767 StringBuilder sb = new StringBuilder ();
6868 List <String > lines = IOUtils .readLines (new FileInputStream (filename ));
@@ -76,28 +76,28 @@ static boolean loadFileToBoosting(Boosting boosting, String filename) throws Fil
7676 return true ;
7777 }
7878
79- static String getBoostingTypeFromModelFile (String filename ) throws FileNotFoundException , IOException {
79+ public static String getBoostingTypeFromModelFile (String filename ) throws IOException {
8080 List <String > lines = IOUtils .readLines (new FileInputStream (filename ));
8181 return lines .get (0 );
8282 }
8383
84- abstract boolean loadModelFromString (String modelStr );
84+ abstract public boolean loadModelFromString (String modelStr );
8585
86- abstract boolean needAccuratePrediction ();
86+ abstract public boolean needAccuratePrediction ();
8787
88- abstract int numberOfClasses ();
88+ abstract public int numberOfClasses ();
8989
90- abstract void initPredict (int num_iteration );
90+ abstract public void initPredict (int num_iteration );
9191
92- abstract int numPredictOneRow (int num_iteration , boolean is_pred_leaf );
92+ abstract public int numPredictOneRow (int num_iteration , boolean is_pred_leaf );
9393
94- abstract int getCurrentIteration ();
94+ abstract public int getCurrentIteration ();
9595
96- abstract int maxFeatureIdx ();
96+ abstract public int maxFeatureIdx ();
9797
98- abstract List <Double > predictLeafIndex (SparseVector vector );
98+ abstract public List <Double > predictLeafIndex (SparseVector vector );
9999
100- abstract List <Double > predictRaw (SparseVector vector , PredictionEarlyStopInstance early_stop );
100+ abstract public List <Double > predictRaw (SparseVector vector , PredictionEarlyStopInstance early_stop );
101101
102- abstract List <Double > predict (SparseVector vector , PredictionEarlyStopInstance early_stop );
102+ abstract public List <Double > predict (SparseVector vector , PredictionEarlyStopInstance early_stop );
103103}
0 commit comments