LogisticRegression
Logistic regression using gradient descent with sigmoid activation. Binary classification only.
Operations
Fit
Fits the model to training data using gradient descent.
method : public : Fit(X:Float[,], y:Float[,]) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| X | Float | feature matrix (rows=samples, cols=features) |
| y | Float | target array (0.0 or 1.0 values, rows=samples, cols=1) |
Return
| Type | Description |
|---|---|
| Bool | true if fitting succeeded |
GetWeights
Gets the learned weights.
method : public : GetWeights() ~ Float[]Return
| Type | Description |
|---|---|
| Float | weight array, or Nil if not fitted |
IsFitted
Whether the model has been fitted.
method : public : IsFitted() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if fitted |
New
Constructor
New(learning_rate:Float, iterations:Int)Parameters
| Name | Type | Description |
|---|---|---|
| learning_rate | Float | step size for gradient descent |
| iterations | Int | number of training iterations |