emat/learn/base.py
def clone_or_construct(estimator):
	"""
	Clone an estimator, or construct a default one from a class or function.

	Parameters
	----------
	estimator : sklearn estimator instance, class, or a function returning same.

	Returns
	-------
	estimator
	"""
	try:
		return clone(estimator)
	except TypeError:
		if inspect.isclass(estimator) or inspect.isfunction(estimator):
			return estimator()
		else:
			raise

	Clone an estimator, or construct a default one from a class or function.

	Parameters
	----------
	estimator : sklearn estimator instance, class, or a function returning same.

	Returns
	-------
	estimator
	
Clone an estimator, or construct a default one from a class or function.
Parameters

estimator : sklearn estimator instance, class, or a function returning same.

Returns

estimator
Clone an estimator or construct a default one from a class or function . Parameters estimator : sklearn estimator instance class or a function returning same . Returns estimator
def clone_or_construct(estimator):
	try:
		return clone(estimator)
	except TypeError:
		if inspect.isclass(estimator) or inspect.isfunction(estimator):
			return estimator()
		else:
			raise
def clone_or_construct ( estimator ) : try : return clone ( estimator ) except TypeError : if inspect . isclass ( estimator ) or inspect . isfunction ( estimator ) : return estimator ( ) else : raise
Clone an estimator, or construct a default one from a class or function.
Clone an estimator or construct a default one from a class or function .
"""
	Clone an estimator, or construct a default one from a class or function.

	Parameters
	----------
	estimator : sklearn estimator instance, class, or a function returning same.

	Returns
	-------
	estimator
	"""
estimator