def mathematics_sparseinversecovariance_modular(data,lc):
	from modshogun import SparseInverseCovariance
	from numpy import dot

	sic = SparseInverseCovariance()
	S = dot(data,data.T)
	Si = sic.estimate(S,lc)

	return Si
Пример #2
0
def mathematics_sparseinversecovariance_modular(data, lc):
    from modshogun import SparseInverseCovariance
    from numpy import dot

    sic = SparseInverseCovariance()
    S = dot(data, data.T)
    Si = sic.estimate(S, lc)

    return Si
def mathematics_sparseinversecovariance_modular (data,lc):
	try:
		from modshogun import SparseInverseCovariance
	except ImportError:
		print("SparseInverseCovariance not available")
		exit(0)
	
	from numpy import dot

	sic = SparseInverseCovariance()
	S = dot(data,data.T)
	Si = sic.estimate(S,lc)

	return Si
def inverse_covariance (data,lc):
	from modshogun import SparseInverseCovariance
	from numpy import dot

	sic = SparseInverseCovariance()

	#by default cov() expects each row to represent a variable, with observations in the columns
	cov = np.cov(data.T)	
	
	max_cov = cov.max()
	min_cov = cov.min()
	
	#comupute inverse conariance matrix
	Si = sic.estimate(cov,lc)

	return Si
def inverse_covariance(data, lc):
    from modshogun import SparseInverseCovariance
    from numpy import dot

    sic = SparseInverseCovariance()

    #by default cov() expects each row to represent a variable, with observations in the columns
    cov = np.cov(data.T)

    max_cov = cov.max()
    min_cov = cov.min()

    #compute inverse conariance matrix
    Si = sic.estimate(cov, lc)

    return Si