Skip to content

Commit

Permalink
refactored maxTrainingSample get and set function so that all classes…
Browse files Browse the repository at this point in the history
… that inherit from splitter can use them
  • Loading branch information
AdamChit committed Sep 20, 2019
1 parent 07fd316 commit e4b8a92
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,24 +338,6 @@ trait DataBalancerParams extends Params {

def getSampleFraction: Double = $(sampleFraction)

/**
* Maximum size of dataset want to train on.
* Value should be > 0.
* Default is 5000.
*
* @group param
*/
final val maxTrainingSample = new IntParam(this, "maxTrainingSample",
"maximum size of dataset want to train on", ParamValidators.inRange(
lowerBound = 0, upperBound = 1 << 30, lowerInclusive = false, upperInclusive = true
)
)
setDefault(maxTrainingSample, SplitterParamsDefault.MaxTrainingSampleDefault)

def setMaxTrainingSample(value: Int): this.type = set(maxTrainingSample, value)

def getMaxTrainingSample: Int = $(maxTrainingSample)

/**
* Fraction to sample minority data
* Value should be > 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,24 @@ trait SplitterParams extends Params {
def setReserveTestFraction(value: Double): this.type = set(reserveTestFraction, value)
def getReserveTestFraction: Double = $(reserveTestFraction)

/**
* Maximum size of dataset want to train on.
* Value should be > 0.
* Default is 1000000.
*
* @group param
*/
final val maxTrainingSample = new IntParam(this, "maxTrainingSample",
"maximum size of dataset want to train on", ParamValidators.inRange(
lowerBound = 0, upperBound = 1 << 30, lowerInclusive = false, upperInclusive = true
)
)
setDefault(maxTrainingSample, SplitterParamsDefault.MaxTrainingSampleDefault)

def setMaxTrainingSample(value: Int): this.type = set(maxTrainingSample, value)

def getMaxTrainingSample: Int = $(maxTrainingSample)

final val labelColumnName = new Param[String](this, "labelColumnName",
"label column name, column 0 if not specified")
private[op] def getLabelColumnName = $(labelColumnName)
Expand Down

0 comments on commit e4b8a92

Please sign in to comment.