xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 8KB
    文件類型: .py
    金幣: 1
    下載: 0 次
    發布日期: 2021-01-05
  • 語言: Python
  • 標簽: Lasso??Python??

資源簡介

利用隨機坐標下降法和循環坐標下降法求解lasso回歸,并作比較。

資源截圖

代碼片段和文件信息

import?numpy?as?np
import?pandas?as?pd
import?matplotlib.pyplot?as?plt
from?sklearn?import?linear_model
from?sklearn?import?preprocessing
from?sklearn.model_selection?import?train_test_split
import?copy

class?Algorithm:
“““
This?is?a?demo?of?using?coordinate?descent?algorithm?(including?both?cyclic?coordinate?descent?
and?randomized?coordinate?descent)?to?solve?the?LASSO?problem?that?is?the?‘l1-regularized?
least-squares?regression?problem.

“““
def?__init__(self?lambduh=6.46?max_iter=1000):
“““
Coordinate?descent?algorithm?to?solve?the?LASSO?problem.

Parameters
----------
lambduh?:?float
Regularization?parameter.
The?default?lambduh?is?set?as?6.46?(the?optimal?lambduh?from?cross?validation?result).?
However?users?are?allowed?set?lambduh?in?the?__main__?function

評論

共有 條評論