Update demo scripts to use installed python library

This commit is contained in:
Skipper Seabold 2015-04-08 14:22:54 -05:00
parent ceb62e9231
commit a0e07f16c4
15 changed files with 27 additions and 65 deletions

View File

@ -1,5 +1,4 @@
#!/usr/bin/python
import sys
def loadfmap( fname ):
fmap = {}

View File

@ -1,10 +1,6 @@
#!/usr/bin/python
import sys
import numpy as np
import scipy.sparse
# append the path to xgboost, you may need to change the following line
# alternatively, you can add the path to PYTHONPATH environment variable
sys.path.append('../../wrapper')
import xgboost as xgb
### simple example

View File

@ -1,7 +1,5 @@
#!/usr/bin/python
import sys
import numpy as np
sys.path.append('../../wrapper')
import xgboost as xgb
dtrain = xgb.DMatrix('../data/agaricus.txt.train')

View File

@ -1,7 +1,5 @@
#!/usr/bin/python
import sys
import numpy as np
sys.path.append('../../wrapper')
import xgboost as xgb
### load data in do training

View File

@ -1,7 +1,5 @@
#!/usr/bin/python
import sys
import numpy as np
sys.path.append('../../wrapper')
import xgboost as xgb
###
# advanced: cutomsized loss function

View File

@ -1,6 +1,4 @@
#!/usr/bin/python
import sys
sys.path.append('../../wrapper')
import xgboost as xgb
##
# this script demonstrate how to fit generalized linear model in xgboost

View File

@ -1,7 +1,5 @@
#!/usr/bin/python
import sys
import numpy as np
sys.path.append('../../wrapper')
import xgboost as xgb
### load data in do training

View File

@ -1,7 +1,5 @@
#!/usr/bin/python
import sys
import numpy as np
sys.path.append('../../wrapper')
import xgboost as xgb
### load data in do training

View File

@ -4,8 +4,6 @@ Created on 1 Apr 2015
@author: Jamie Hall
'''
import sys
sys.path.append('../../wrapper')
import xgboost as xgb
import numpy as np

View File

@ -1,7 +1,5 @@
#!/usr/bin/python
import sys
import numpy as np
sys.path.append('../../wrapper')
import xgboost as xgb
### load data in do training

View File

@ -1,14 +1,6 @@
#!/usr/bin/python
# this is the example script to use xgboost to train
import inspect
import os
import sys
import numpy as np
# add path of xgboost python module
code_path = os.path.join(
os.path.split(inspect.getfile(inspect.currentframe()))[0], "../../wrapper")
sys.path.append(code_path)
import xgboost as xgb

View File

@ -1,9 +1,6 @@
#!/usr/bin/python
# make prediction
import sys
import numpy as np
# add path of xgboost python module
sys.path.append('../../wrapper/')
import xgboost as xgb
# path to where the data lies

View File

@ -1,9 +1,6 @@
#!/usr/bin/python
# this is the example script to use xgboost to train
import sys
import numpy as np
# add path of xgboost python module
sys.path.append('../../wrapper/')
import xgboost as xgb
from sklearn.ensemble import GradientBoostingClassifier
import time

View File

@ -1,7 +1,5 @@
#! /usr/bin/python
import sys
import numpy as np
sys.path.append('../../wrapper/')
import xgboost as xgb
# label need to be 0 to num_class -1

View File

@ -1,5 +1,4 @@
#!/usr/bin/python
import sys
fo = open( 'machine.txt', 'w' )
cnt = 6