预测线性回归

本文介绍了如何在PyCharm环境下创建Python文件,安装所需的模块如sklearn,并详细讲解了安装过程。同时分享了一些PyCharm的常用快捷键。在进行线性回归预测时遇到X值类型错误,通过添加代码predictvalue=np.array(predictvalue).reshape(1,-1)解决了问题,解释了reshape函数中-1的含义。" 5025884,252352,获取GOOGLE地图点击点经纬度的方法,"['javascript', 'google地图api', '地图交互', '坐标获取']
摘要由CSDN通过智能技术生成
# This is a sample Python script.

# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.


def print_hi(name):
    # Use a breakpoint in the code line below to debug your script.
    print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print_hi('PyCharm')

# See PyCharm help at https://www.jetbrains.com/help/pycharm/
import numpy as np
import matplotlib.pyplot as plt
import  pandas as pd
from sklearn import datasets,linear_model

#读取数据
def get_data(input_data):
    data = pd.read_csv('input_data.csv')
    X_parameter = []
    Y_parameter = []
    for single_square_feet,single_price_value in zip(data['square_feet'],data['price']):
        X_parameter.append([float(single_s
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值