如何从statsmodels olsWLS回归2D参数测试得到的prediction

The code that I'm writing has two classes: writeInts and readInts. I wrote writeInts to randomly generate 100 numbers between 0 and 1000 and output them to a data.dat file.
readInts is supposed to open a DataInputStream object and read in the "raw" data from the data.dat file and store the 100 integers in an array. My problem is that I can't seem to read the data correctly. Any help with this would be greatly appreciated. Thanks!
writeInts:
import java.io.*;
public class WriteInts {
public static void main(String[] args) throws IOException {
DataOutputStream output = new DataOutputStream(new FileOutputStream("data.dat"));
int num = 0 + (int)(Math.random());
int[] counts = new int[100];
for(int i=0; i&100; i++) {
output.writeInt(num);
counts[i] +=
System.out.println(num);
output.close();
import java.io.*;
import java.util.*;
public class ReadInts {
public static void main(String[] args) throws IOException {
// call the file to read
Scanner scanner = new Scanner(new File("data.dat"));
int[] data = new int[100];
int i = 0;
while (scanner.hasNextInt()) {
data[i++] = scanner.nextInt();
System.out.println(data[i]);
scanner.close();
解决方案 If you want to write binary data, use DataInputStream/DataOutputStream. Scanner is for text data and you can't mix it.
WriteInts:
import java.io.*;
public class WriteInts {
public static void main(String[] args) throws IOException {
DataOutputStream output = new DataOutputStream(new FileOutputStream(
"data.dat"));
for (int i = 0; i & 100; i++) {
output.writeInt(i);
System.out.println(i);
output.close();
import java.io.DataInputS
import java.io.FileInputS
import java.io.IOE
public class ReadInts {
public static void main(String[] args) throws IOException {
DataInputStream input = new DataInputStream(new FileInputStream(
"data.dat"));
while (input.available() & 0) {
int x = input.readInt();
System.out.println(x);
input.close();
本文地址: &
在code,我正在写有两类:writeInts和readInts。我写writeInts随机生成0和1000,并将其输出之间100号到Data.dat文件。 readInts应该打开一个DataInputStream的对象,并在从Data.dat文件的“原始”数据读和100的整数存储在数组中。我的问题是,我似乎无法正确读取数据。任何帮助,这将大大AP preciated。谢谢! writeInts: 进口java.io. *;公共类WriteInts {
公共静态无效的主要(字串[] args)抛出IOException
DataOutputStream类输出=新的DataOutputStream类(新的FileOutputStream(“data.dat文件”));
INT NUM = 0 +(int)的(的Math.random());
INT [] =计数INT新[100];
的for(int i = 0; I< 100;我++){
output.writeInt(NUM);
计数[I] + = NUM;
的System.out.println(NUM);
output.close();
readInts: 进口java.io. *;进口的java.util。*;公共类ReadInts {
公共静态无效的主要(字串[] args)抛出IOException
//调用文件阅读
扫描仪扫描=新的扫描仪(新的文件(“data.dat文件”));
INT []数据= INT新[100];
INT I = 0;
而(scanner.hasNextInt()){
数据[我++] = scanner.nextInt();
的System.out.println(数据由[i]);
scanner.close();
}} 解决方案 如果你想要写的二进制数据,使用的 DataInputStream所/ DataOutputStream类的。 扫描仪的是文字数据并不能混用。 WriteInts: 进口java.io. *;公共类WriteInts {
公共静态无效的主要(字串[] args)抛出IOException
DataOutputStream类输出=新的DataOutputStream类(新的FileOutputStream(
“data.dat文件”));
的for(int i = 0; I< 100;我++){
output.writeInt(ⅰ);
的System.out.println(ⅰ);
output.close();
ReadInts: 进口java.io.DataInputStream中;进口java.io.FileInputStream中;进口java.io.IOException异常;公共类ReadInts {
公共静态无效的主要(字串[] args)抛出IOException
DataInputStream以输入=新DataInputStream所(新的FileInputStream(
“data.dat文件”));
而(input.available()大于0){
INT X = input.readInt();
的System.out.println(X);
input.close();
本文地址: &
扫一扫关注官方微信On derivation of differential equations of coupled-mode propagation from the reciprocity principle. - Abstract - Europe PMC
Europe PMC requires Javascript to function effectively.
Either your web browser doesn't support Javascript or it is currently turned off. In the latter case, please
turn on Javascript support in your web browser and reload this page.
https://orcid.org
Search worldwide, life-sciences literature
Oleg Godin
Comment, Letter
This is a comment on && J Acoust Soc Am.
Pt 1):3020-3.
No abstract provided.
)- subscription required
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
Show all items
CitePeer Related Articles

我要回帖

更多关于 statsmodels 逻辑回归 的文章

 

随机推荐