MCPcopy Create free account
hub / github.com/rushter/MLAlgorithms / ElasticNet

Class ElasticNet

mla/neuralnet/regularizers.py:31–35  ·  view source on GitHub ↗

Linear combination of L1 and L2 penalties.

Source from the content-addressed store, hash-verified

29
30
31class ElasticNet(Regularizer):
32 """Linear combination of L1 and L2 penalties."""
33
34 def _penalty(self, weights):
35 return 0.5 * self.C * weights**2 + (1.0 - self.C) * np.abs(weights)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected