A simple to "path" ElasticNet parameters ( in python)
来源:互联网 发布:野兽派有淘宝店吗 编辑:程序博客网 时间:2024/05/22 10:38
import numpy as npimport sysimport mathtrfile=sys.argv[1]tlabel=sys.argv[2]parafile=sys.argv[3]from sklearn.linear_model import ElasticNetCVA=np.genfromtxt(trfile);label=np.loadtxt(tlabel,dtype=np.int8);clscv=ElasticNetCV(cv=3, l1_ratio=0.9);clscv.fit(A,label)y="%s %s" %(clscv.alpha_ ,clscv.l1_ratio)f = file(parafile, 'w') # open for 'w'ritingf.write(y);f.closeprint y
trfile : training data
tlabel:label data
parafile: file to save parameters
two parameters: alpha and l1_ratio
but............set l1_ratio = 0.9
A better method will update to combine l1_ratio inside :)
0 0
- A simple to "path" ElasticNet parameters ( in python)
- Making a simple web server in Python
- Write a simple HTTP server in Python
- A simple unix/linux daemon in Python
- a simple email test in python
- How to create a simple Ad Hoc Reporting in HR ?
- A simple way to read an XML file in Java
- How to configure a simple WebDAV in apache
- How to write a simple interpreter in JavaScript
- Simple way to repeat a String in java
- Matrix Factorization: A Simple Tutorial and Implementation in Python
- Matrix Factorization: A Simple Tutorial and Implementation in Python
- Matrix Factorization: A Simple Tutorial and Implementation in Python
- add a new path to visit in matlab
- How to get a path to a resource in a Java JAR file
- python 的 chromedriver' executable needs to be in PATH.
- 【LEETCODE】329-Longest Increasing Path in a Matrix [Python]
- A poor simple sample to perfectly introduce how to program in CUDA
- 灵活强大的构建系统Gradle
- 又见返回栈指针
- poj_2752 Seek the Name, Seek the Fame
- AT&T 和 Intel 汇编语法的主要区别
- 海量数据处理 百度面试题 从40亿IP地址中取出出现次数最多的那个IP地址,我的解法
- A simple to "path" ElasticNet parameters ( in python)
- oracle的事务隔离级别。
- JAVA学习第十课(单例设计模式)
- synchronized和LOCK的实现
- 数字哑谜和回文
- 设计模式C++练习(1)_工厂模式
- java实现两个栈模拟实现队列出队
- atoi
- KMP算法分析