第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

我在 Python 中使用帶有 MLeap 的 Scikit-Learn

我在 Python 中使用帶有 MLeap 的 Scikit-Learn

精慕HU 2022-12-20 16:44:40
試過(guò)了:#Generate dataimport pandas as pd import numpy as npdf = pd.DataFrame(np.random.randn(100, 5), columns=['a', 'b', 'c', 'd', 'e'])df["y"] = (df['a'] > 0.5).astype(int)df.head()from mleap.sklearn.ensemble.forest import RandomForestClassifierforestModel = RandomForestClassifier()forestModel.mlinit(input_features='a',                   feature_names='a',                           prediction_column='e_binary')forestModel.fit(df[['a']], df[['y']])forestModel.serialize_to_bundle("jar:file:/dbfs/FileStore/tables/mleaptestmodelforestpysparkzip", "randomforest.zip")我收到此錯(cuò)誤:No such file or directory: 'jar:file:/dbfs/FileStore/tables/mleaptestmodelforestpysparkzip/randomforest.zip.node'我也試過(guò)了:forestModel.serialize_to_bundle("jar:file:/dbfs/FileStore/tables/mleaptestmodelforestpysparkzip/randomforest.zip")并收到一條錯(cuò)誤消息,指出缺少“model_name”屬性。請(qǐng)問(wèn)你能幫幫我嗎?我添加了我嘗試做的所有事情以及我得到的結(jié)果:管道到 Zip:1.pipeline.serialize_to_bundle("jar:file:/dbfs/FileStore/tables/mleap/pipeline_zip/1/model.zip", model_name="forest")=> FileNotFoundError: [Errno 2] 沒有這樣的文件或目錄:'jar:file:/dbfs/FileStore/tables/mleap/pipeline_zip/1/model.zip/model.json'2.pipeline.serialize_to_bundle("jar:file:/dbfs/FileStore/tables/mleap/pipeline_zip/1/model.zip", model_name="forest", init=True)FileNotFoundError: [Errno 2] 沒有這樣的文件或目錄:'jar:file:/dbfs/FileStore/tables/mleap/pipeline_zip/1/model.zip/forest'要壓縮的模型forest.serialize_to_bundle("jar:file:/dbfs/FileStore/tables/mleap/random_forest_zip/1/model.zip", model_name="forest")=> FileNotFoundError: [Errno 2] 沒有這樣的文件或目錄:'jar:file:/dbfs/FileStore/tables/mleap/random_forest_zip/1/model.zip/forest.node'forest.serialize_to_bundle("jar:file:/dbfs/FileStore/tables/mleap/random_forest_zip/1", model_name="model.zip")=> FileNotFoundError: [Errno 2] 沒有這樣的文件或目錄:'jar:file:/dbfs/FileStore/tables/mleap/random_forest_zip/1/model.zip.node'forest.serialize_to_bundle("/dbfs/FileStore/tables/mleap/random_forest_zip/1", model_name="model.zip")=> 不要保存 zip。而是保存一個(gè)包。
查看完整描述

1 回答

?
天涯盡頭無(wú)女友

TA貢獻(xiàn)1831條經(jīng)驗(yàn) 獲得超9個(gè)贊

我發(fā)現(xiàn)了問(wèn)題和解決方法。

不再可能使用 Databricks 進(jìn)行隨機(jī)寫入,如下所述:https ://docs.databricks.com/data/databricks-file-system.html?_ga=2.197884399.1151871582.1592826411-509486897.1589442523#local-file-apis

解決方法是在本地文件系統(tǒng)中寫入 zip 文件,然后將其復(fù)制到 DBFS 中。所以:

  1. 使用“init=True”在管道中序列化您的模型,將其保存在本地目錄中

  2. 使用“dbutils.fs.cp(source, destination)”將其復(fù)制到您的數(shù)據(jù)湖

dbutils.fs.cp(來(lái)源,目的地)


查看完整回答
反對(duì) 回復(fù) 2022-12-20
  • 1 回答
  • 0 關(guān)注
  • 116 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)