This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plt.plot(x, y, 'go', label = 'from data', alpha = .5) | |
plt.legend() | |
plt.show() | |
plt.clf() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stick our data in a dataframe: | |
df = pd.DataFrame({'x': x, 'y': y}); | |
# use 20% of our data for validation: | |
valid_idx = random.sample(list(df.index), int(0.2 * len(df))); | |
# what we're predicting: | |
dep_var = 'y' | |
# we don't have any categorical variables: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model = LinearRegressionModel(); | |
print(model); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
learn = Learner(data, model); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model = TabularModel(emb_szs={}, n_cont=1, out_sz=1, layers=[10]); | |
print(model) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
preds, targs = learn.get_preds() | |
x_val = x[valid_idx]; | |
y_val = np.array(targs); | |
y_hat = np.array(preds.flatten()) | |
plt.plot(x_val, y_val, 'go', label = 'tagets', alpha = .5) | |
plt.plot(x_val, y_hat, 'ro', label = 'preds', alpha = .5) | |
plt.legend() | |
plt.show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
GraphQLBoolean, | |
GraphQLError, | |
GraphQLList, | |
GraphQLNonNull, | |
GraphQLString | |
} from 'graphql'; | |
import { | |
fromGlobalId, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extend type Query { | |
__schema: __Schema! | |
__type(name: String!): __Type | |
} | |
type __Schema { | |
description: String | |
types: [__Type!]! | |
queryType: __Type! | |
mutationType: __Type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffadce40-ace0-4547-b248-baf8bf6fa1cf | f0154557-bdb7-4c3c-b479-6ea2852a5cac |
---|