#data
library(lars)
data(diabetes)
attach(diabetes)

#glmnet
library(glmnet)
library(foreach)
library(Matrix)
gt <- cv.glmnet(x, y, nfolds = 10)
# plot(gt)
gt.coef <- coef(gt$glmnet.fit, s = gt$lambda.1se)
gt.coef
gt.coef[which(gt.coef != 0)]
rownames(gt.coef)[which(gt.coef != 0)]

何用glmnet或lars包进行feature selection的更多相关文章

  1. 机器学习-特征选择 Feature Selection 研究报告

    原文:http://www.cnblogs.com/xbinworld/archive/2012/11/27/2791504.html 机器学习-特征选择 Feature Selection 研究报告 ...

  2. 【转】[特征选择] An Introduction to Feature Selection 翻译

    中文原文链接:http://www.cnblogs.com/AHappyCat/p/5318042.html 英文原文链接: An Introduction to Feature Selection ...

  3. [Feature] Feature selection

    Ref: 1.13. Feature selection Ref: 1.13. 特征选择(Feature selection) 大纲列表 3.1 Filter 3.1.1 方差选择法 3.1.2 相关 ...

  4. [Feature] Feature selection - Embedded topic

    基于惩罚项的特征选择法 一.直接对特征筛选 Ref: 1.13.4. 使用SelectFromModel选择特征(Feature selection using SelectFromModel) 通过 ...

  5. 单因素特征选择--Univariate Feature Selection

    An example showing univariate feature selection. Noisy (non informative) features are added to the i ...

  6. 10-3[RF] feature selection

    main idea: 计算每一个feature的重要性,选取重要性前k的feature: 衡量一个feature重要的方式:如果一个feature重要,则在这个feature上加上noise,会对最后 ...

  7. Feature Selection Can Reduce Overfitting And RF Show Feature Importance

    一.特征选择可以减少过拟合代码实例 该实例来自机器学习实战第四章 #coding=utf-8 ''' We use KNN to show that feature selection maybe r ...

  8. highly variable gene | 高变异基因的选择 | feature selection | 特征选择

    在做单细胞的时候,有很多基因属于noise,就是变化没有规律,或者无显著变化的基因.在后续分析之前,我们需要把它们去掉. 以下是一种找出highly variable gene的方法: The fea ...

  9. the steps that may be taken to solve a feature selection problem:特征选择的步骤

    參考:JMLR的paper<an introduction to variable and feature selection> we summarize the steps that m ...

随机推荐

  1. python常用模块之xml模块

    python常用模块之xml模块 xml是实现不同语言或程序之间进行数据交换的协议,跟json差不多,但json使用起来更简单,不过,在json还没诞生的年代,大家都是使用xml,目前很多传统公司的系 ...

  2. python爬虫入门(1)-urllib模块

    作用:用于读取来自网上(服务器上)的数据   基本方法:urllib.request.urlopen(url,data=None,[]timeout]*,cafile=None,cadefault=F ...

  3. IE只是开始!

    Study is boring,but devotion make it is easy!

  4. Android中的按键顺序打乱

    首先要找到相对应的控件,之后再来一个数组,再把数组里面的数字显示到控件上面. private void initView() { mNum0 = (Button) findViewById(R.id. ...

  5. CXF生成本地ws调用代码测试webservice

    package com.free.webservice.client; import java.util.List; import cn.com.webxml.*; public class Weat ...

  6. git学习笔记——查看git历史记录

    1.查看Git日志: 命令:git log 默认不加参数,git日志会按照最新的日期从上往下显示 参数:-p 显示版本间的代码差异 -数字 显示部分的提交 -哈希值 显示指定的版本 2.指定查找范围: ...

  7. HihoCoder1050 树中的最长路 树形DP第三题(找不到对象)

    题意:求出的树中距离最远的两个结点之间相隔的距离. 水题一道,以前只会用路的直径来解. 代码如下: #include<cstdio> #include<cstdlib> #in ...

  8. Loj 2028 随机序列

    Loj 2028 随机序列 连续的乘号会将序列分成若干个块,块与块之间用加减号连接: \[ (a_1*a_2*...a_i)\pm(a_{i+1}*a_{i+2}*...a_j)\pm... \] 除 ...

  9. VS 编译太慢了吗?新建解决方案配置关闭一部分项目的编译

    手头的解决方案真大!里面的项目个数达到了 30 个或是 50 个?然而接近一半是单元测试项目和辅助工具.再加上一些不尽如人意的项目优化,编译速度真的是无力吐槽.幸好 Visual Studio 提供了 ...

  10. Object-C 中的Selector 概念

    selector可以叫做选择器,其实指的就是对象的方法,也可以理解为C语言里面的函数指针,在面向对象里面的对应概念. @selector(xxxx)的作用是找到名字为xxxx的方法.一般用于[a pe ...