当前位置: 首页>>代码示例>>Python>>正文


Python Feature.transform方法代码示例

本文整理汇总了Python中feature.Feature.transform方法的典型用法代码示例。如果您正苦于以下问题:Python Feature.transform方法的具体用法?Python Feature.transform怎么用?Python Feature.transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在feature.Feature的用法示例。


在下文中一共展示了Feature.transform方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import transform [as 别名]
def main():
    X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
    
    root = Feature('root')
    featureList = np.array([])
    for i in range(len(X[0])):
        feature = Feature('feature_%d' % i)
        root.transform('init', feature)
        featureList = np.append(featureList, feature)

    model = PCA(n_components=1)
    model.fit(X)
    doWithPCA(model, featureList)
    root.printTree()
开发者ID:jasonfreak,项目名称:ple,代码行数:16,代码来源:many2many.py

示例2: main

# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import transform [as 别名]
def main():
    X = [[1, 2], [2, 3]]
    
    root = Feature('root')
    featureList = np.array([])
    for i in range(len(X[0])):
        feature = Feature('feature_%d' % i)
        root.transform('init', feature)
        featureList = np.append(featureList, feature)

    model = OneHotEncoder(n_values=[5,8], sparse=True)
    model.fit(X)
    doWithOneHotEncoder(model, featureList)
    root.printTree()
开发者ID:jasonfreak,项目名称:ple,代码行数:16,代码来源:one2many.py

示例3: main

# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import transform [as 别名]
def main():
    from sklearn.feature_selection import VarianceThreshold
    X = [[0, 2, 0, 3], [0, 1, 4, 3], [0, 1, 1, 3]]
    
    root = Feature('root')
    featureList = np.array([])
    for i in range(len(X[0])):
        feature = Feature('feature_%d' % i)
        root.transform('init', feature)
        featureList = np.append(featureList, feature)

    model = VarianceThreshold()
    model.fit(X)
    doWithSelector(model, featureList)
    root.printTree()
开发者ID:jasonfreak,项目名称:ple,代码行数:17,代码来源:one2one.py

示例4: initRoot

# 需要导入模块: from feature import Feature [as 别名]
# 或者: from feature.Feature import transform [as 别名]
def initRoot(featureNameList):
    root = Feature('root')
    for featureName in featureNameList:
        newFeature = Feature(featureName)
        root.transform('init', newFeature)
    return root
开发者ID:jasonfreak,项目名称:ple,代码行数:8,代码来源:ple.py


注:本文中的feature.Feature.transform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。